Created
December 4, 2014 10:10
-
-
Save nickcernis/f43b795bef063ce3ffc1 to your computer and use it in GitHub Desktop.
Fix for breadcrumbs appearing on iThemes ghost pages with Genesis themes
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 // be sure to remove this line! | |
// Workaround for iThemes Exchange breadcrumbs issue. | |
// Strip breadcrumbs on iThemes Exchange ghost pages unless | |
// Genesis settings have enabled breadcrumbs on pages. | |
add_action( 'genesis_before_content', 'studiopress_it_exchange_breadcrumbs' ); | |
function studiopress_it_exchange_breadcrumbs() { | |
global $post; | |
$is_ghost_page = strpos($post->post_name, 'it-exchange-ghost'); | |
if ( $is_ghost_page === false || genesis_get_option( 'breadcrumb_page' ) ) | |
return; | |
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
} |
Jorge's issue was fixed via email. It's important to also uncheck the “Pages” tickbox in Genesis > Theme Settings > Breadcrumbs to stop breadcrumbs appearing on the iThemes Exchange pages.
If you'd like to be able to add breadcrumbs to regular pages by ticking the “Pages” box in the Breadcrumbs settings without also adding them to the Exchange pages, modify line 14 to look like this:
if ( $is_ghost_page === false )
Awesome, thanks!
Worked!, thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It didn't work. I added your code to my Genesis Enterprise Pro functions.php, the breadcrumbs still shows on my iTheme Exchange 'store'.