Archived topic
Hide Breadcrumbs
14 replies · Started by Sebastián on November 24, 2017
Hi I put this code in the header.php file:
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('
<p id="breadcrumbs">','</p>
');
}
?>
And i enabled the breadcrumbs by Yoast.
But the only reason I want the breadcrumbs is for google searches.
Is there a way to hide the actual breadcrumbs from the pages? I don't want them to appear.
Just did it for Google Search.
Thanks
Hi there,
Try this:
<?php if ( function_exists('yoast_breadcrumb') && ! is_page() && ! is_home() ) : ?>
<?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?>
<?php endif; ?>
So I need to put that code instead of the other one?
Yes
The breadcrumbs still appear on the blog page and blog posts.
And I already choose "hide on blog page" in the yoast advanced menu.
The condition I gave you is only to exclude pages?
If we hide on pages, main blog page, and posts, where is it supposed to show?
I would like to display breadcrumbs on the single blog posts down the featured images at the start of the posts. But not here: https://i.imgur.com/xDwxMb4.png
Thanks!
Then maybe the After Entry Title hook? http://demo.generatepress.com/hook-locations/
Ok I put it in the Before Content Hook. Is there a code to center it? https://www.mmarketingonline.com/factores-claves-marketing-digital/
Had to wrong quotation before. Fixed it above: https://generatepress.com/forums/topic/hide-breadcrumbs/#post-433271
Then you can use this CSS to center it:
#breadcrumbs {
text-align: center;
}
Great now I have it the way I wanted it!
But can I hide breadcrumbs on the blog page? https://i.imgur.com/HEbQjul.png
https://www.mmarketingonline.com/blog/
Another thing, code to reduce the margin between the featured image and the post title in the blog page? https://i.imgur.com/vFKi7BG.png
Adjusted the code above to exclude blog page: https://generatepress.com/forums/topic/hide-breadcrumbs/#post-433271
This should work for the margin:
.post-image-above-header .inside-article .post-image {
margin-bottom: 1em;
}
Breadcrumbs are working so everything is good but...
Why they are not displaying the blog category and how to do it? https://i.imgur.com/wbIlz3F.png
They are also not displaying the title of the web they are displaying the url
Looks like this: URL - Blog
But I want: Web Title (MMarketingOnline) - Blog - Category
Hope I made myself clear.
Thanks!
You’d have to check with where the breadcrumb code came from. GP hooks simply displays the content and does not alter the structure.