- This topic has 14 replies, 2 voices, and was last updated 7 years, 2 months ago by
Leo.
-
AuthorPosts
-
November 24, 2017 at 2:49 pm #433167
Sebastián
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
November 24, 2017 at 5:42 pm #433271Leo
StaffCustomer SupportHi there,
Try this:
<?php if ( function_exists('yoast_breadcrumb') && ! is_page() && ! is_home() ) : ?> <?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?> <?php endif; ?>
November 25, 2017 at 5:50 am #433672Sebastián
So I need to put that code instead of the other one?
November 25, 2017 at 6:33 am #433699Leo
StaffCustomer SupportYes
November 25, 2017 at 6:35 am #433702Sebastián
The breadcrumbs still appear on the blog page and blog posts.
And I already choose “hide on blog page” in the yoast advanced menu.
November 25, 2017 at 6:49 am #433770Leo
StaffCustomer SupportThe 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?
November 25, 2017 at 11:19 am #433995Sebastián
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!
November 25, 2017 at 1:28 pm #434096Leo
StaffCustomer SupportThen maybe the After Entry Title hook? http://demo.generatepress.com/hook-locations/
November 25, 2017 at 1:41 pm #434109Sebastián
Ok I put it in the Before Content Hook. Is there a code to center it? https://www.mmarketingonline.com/factores-claves-marketing-digital/
November 25, 2017 at 2:19 pm #434138Leo
StaffCustomer SupportHad 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; }
November 25, 2017 at 2:25 pm #434147Sebastián
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/November 25, 2017 at 4:01 pm #434189Sebastián
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
November 25, 2017 at 7:12 pm #434271Leo
StaffCustomer SupportAdjusted 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; }
November 30, 2017 at 2:08 pm #439106Sebastián
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!
November 30, 2017 at 3:41 pm #439157Leo
StaffCustomer SupportYou’d have to check with where the breadcrumb code came from. GP hooks simply displays the content and does not alter the structure.
-
AuthorPosts
- You must be logged in to reply to this topic.