How can I remove breadcrumbs in specific landing pages for esthetic purpose?
Breadcrumb
Hi LCH
Can you please, send a link to the page concerned so I can take a look.
This reply has been marked as private.
Thanks for the link. Which plugin are you using for the breadcrumbs?
Breadcrumb NavXT has the options you’re looking for: https://wordpress.org/plugins/breadcrumb-navxt/.
I’m using Yoast SEO. Is there any way to do that with Yoast?
I’m not sure if Yoast has the same granular settings but you can check them out.
https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/
Looks like you can set the post types for display. Scroll down at the above link to see where the settings are.
I still cannot hide breadcrumbs on pages even with breadcrumb navxt. Can you show me the way to do that?
It seems that the theme polestar has already implemented the breadcrumb code for both Yoast and Breadcrumb Navxt. However, I cannot find the code in the theme files. If you can show me where it is, I might be able to choose where to show the breadcrumbs with a child theme.
Hi, I just sent this link https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/ so you could see where the Yoast settings are to be found for breadcrumbs.
You can insert the following into your child theme functions.php file:
if ( ! function_exists( 'polestar_breadcrumbs' ) ) :
/**
* Display Yoast SEO breadcrumbs or Breadcrumb NavXT below the header.
*/
function polestar_breadcrumbs() {
if ( is_page() ) return;
if ( function_exists( 'bcn_display' ) ) {
?><div class="breadcrumbs bcn">
<?php bcn_display(); ?>
</div><?php
} elseif ( function_exists( 'yoast_breadcrumb' ) ) {
yoast_breadcrumb( '<div class="breadcrumbs">','</div>' );
}
}
endif;
add_action( 'polestar_content_top', 'polestar_breadcrumbs' );I’m sorry but I lost you somewhere…
In the link you sent me, they said that the implementation code is often put in to single.php and/or page.php or header.php. But I can’t find any code like that in these files.
The link I sent was only to show you where the Yoast SEO settings were.
“Looks like you can set the post types for display. Scroll down at the above link to see where the settings are.”
There is no need to insert code for Polestar, the integration code is already there.
Please, insert the function I provided above in your child theme functions.php file. I’ve included an early return in the function to exclude pages.
It works perfectly now, thank you very much.
Awesome 🙂 Glad to hear that helped.
All the best.