'; } // Callback function for the 'Tablet Breakpoint' field function lcp_tablet_breakpoint_field() { $options = get_option('lcp_theme_settings'); $tablet_breakpoint = isset($options['tablet_breakpoint']) ? $options['tablet_breakpoint'] : 1024; echo ''; } function lcp_theme_settings_sanitize($input) { // Sanitize mobile breakpoint $input['mobile_breakpoint'] = isset($input['mobile_breakpoint']) ? absint($input['mobile_breakpoint']) : 768; // Sanitize tablet breakpoint $input['tablet_breakpoint'] = isset($input['tablet_breakpoint']) ? absint($input['tablet_breakpoint']) : 1024; return $input; } // Inject breakpoints to frontned function lcp_inject_breakpoints_to_frontend() { // Get the breakpoints from the settings $options = get_option('lcp_theme_settings'); $mobile_breakpoint = isset($options['mobile_breakpoint']) ? $options['mobile_breakpoint'] : 768; $tablet_breakpoint = isset($options['tablet_breakpoint']) ? $options['tablet_breakpoint'] : 1024; // Inject the CSS variables into the head of the document echo ""; } add_action('wp_head', 'lcp_inject_breakpoints_to_frontend'); // Function to output the checkbox for 'Enable Key Points Meta' function lcp_enable_key_points_meta_field() { // Retrieve current value for 'enable_key_points_meta' $options = get_option( 'lcp_theme_settings', array() ); $checked = isset( $options['enable_key_points_meta'] ) ? $options['enable_key_points_meta'] : false; // Output the checkbox echo ''; } function lcp_enable_highlight_to_share() { // Retrieve current value for 'enable_highlight_to_share' $options = get_option( 'lcp_theme_settings', array() ); $checked = isset( $options['enable_highlight_to_share'] ) ? $options['enable_highlight_to_share'] : false; // Output the checkbox echo ''; } // The callback function to display the custom code inserterpage content function lcp_custom_code_inserter_page() { // Get the stored options from wp_options $custom_code = get_option( 'custom_code_options', array() ); ?>

Custom Code Settings

LCP Custom Code Inserter is currently disabled.

You can add and modify code snippets, but they will not be in effect.

"; } ?>
CSS in Header
JavaScript in Header
JavaScript in Footer
' . $custom_code['js_header'] . ''; } // Check and output CSS for header if ( isset( $custom_code['css_header'] ) && ! empty( $custom_code['css_header'] ) ) { echo ''; } } // Check if the hook is for the footer if ($hook == "footer") { // Check and output JS for footer if ( isset( $custom_code['js_footer'] ) && ! empty( $custom_code['js_footer'] ) ) { echo ''; } } } } // Attach to wp_head and wp_footer, passing the location as a parameter add_action( 'wp_head', function() { lcp_custom_code_output('header'); }); add_action( 'wp_footer', function() { lcp_custom_code_output('footer'); }); function render_lcp_theme_settings_page() { ?>

Theme Settings

Hey there! Share this:

Facebook | Twitter/X "; } function lcp_wp_head_hooks(){ // Define lcp_theme_settings array from wp_options $options = get_option('lcp_theme_settings', array()); // Echo highlight-to-share markup and enqueue javascript // Highlight-to-share css is already in style.css if ( isset($options['enable_highlight_to_share']) && $options['enable_highlight_to_share'] ) { highlight_to_share_popup(); wp_enqueue_script( 'lcp-highlight-to-share', get_template_directory_uri() . '/assets/js/highlight-to-share.js', array(), null, true ); } } add_action('wp_head', 'lcp_wp_head_hooks');