Last active
March 20, 2026 00:32
-
-
Save blogjunkie/c24142183ef5c23964fb183f9e35ea85 to your computer and use it in GitHub Desktop.
Disable page title in Hello theme if Elementor is active
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(); | |
| // 2. Ensure we actually have a post ID before proceeding | |
| if ( ! $post_id ) { | |
| return $return; | |
| } | |
| // 3. Get the document and check if it exists safely | |
| $document = \Elementor\Plugin::$instance->documents->get( $post_id ); | |
| if ( $document && $document->is_built_with_elementor() ) { | |
| return false; | |
| } | |
| return $return; | |
| } | |
| add_filter( 'hello_elementor_page_title', 'ele_disable_page_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment