This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't copy this line | |
| function ele_disable_page_title( $return ) { | |
| // 1. Bail early if it's a 404 page to keep the title visible | |
| if ( is_404() || is_search() || is_archive() ) { | |
| return $return; | |
| } | |
| $post_id = get_the_ID(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Custom page titles for Guest Authors with WordPress SEO | |
| * Returns "[author name]'s articles on [site name]" | |
| * | |
| */ | |
| add_filter('wpseo_title', 'my_co_author_wseo_title'); | |
| function my_co_author_wseo_title( $title ) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't copy this line | |
| $post_id = get_queried_object_id(); | |
| $is_elementor = false; | |
| if ( function_exists('did_action') && did_action('elementor/loaded') ) { // Check if Elementor is loaded | |
| $is_elementor = \Elementor\Plugin::instance()->db->is_built_with_elementor( $post_id ); | |
| } else { | |
| // Fallback when Elementor isn't loaded: check post meta flag | |
| $is_elementor = get_post_meta( $post_id, '_elementor_edit_mode', true ) === 'builder'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Do not copy this line | |
| /** | |
| * Place this shortcode in the form confirmation message. Usage: | |
| * | |
| * [ga4_event] will send 'form_submit' event by default | |
| * [ga4_event name="submit_enquiry"] to send 'submit_enquiry' event | |
| * [ga4_event name="subscribed_to_newsletter"] to send 'subscribed_to_newsletter' event | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Do not copy this line | |
| function child_exclude_noindex_from_search( $query ) { | |
| if( $query->is_main_query() && $query->is_search() ) { | |
| $meta_query = isset( $query->meta_query ) ? $query->meta_query : array(); | |
| $meta_query['noindex'] = array( | |
| 'key' => 'rank_math_robots', | |
| 'value' => "noindex", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't include this line | |
| /** | |
| * Add new font group (Custom) to the top of the list | |
| */ | |
| add_filter( 'elementor/fonts/groups', function( $font_groups ) { | |
| $new_font_group = array( 'custom' => __( 'Custom' ) ); | |
| return array_merge( $new_font_group, $font_groups ); | |
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't copy this line | |
| function example_theme_support() { | |
| remove_theme_support( 'widgets-block-editor' ); | |
| } | |
| add_action( 'after_setup_theme', 'example_theme_support' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Let's say we have an ACF repeater field with 2 sub-fields: | |
| * | |
| * Section | |
| * - Title | |
| * - Description | |
| * | |
| * This code snippet will automatically load 3 instances of the Section, and pre-fill the titles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't copy this line | |
| /** | |
| * Add 'Awaiting pre-order' custom status | |
| * | |
| * 1. Register new order status | |
| * 2. Add to list of WC order statuses | |
| * 3. Add your custom bulk action in dropdown | |
| * 4. Bulk action handler | |
| * 5. Admin notices for bulk action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // don't copy this line | |
| add_filter( 'pp_post_image_settings_data', function( $data, $settings ) { | |
| if ( isset( $data['attributes'] ) && isset( $data['attributes']['data-no-lazy'] ) ) { | |
| unset( $data['attributes']['data-no-lazy'] ); | |
| } | |
| return $data; | |
| }, 10, 3 ); |
NewerOlder