- This topic has 9 replies, 2 voices, and was last updated 5 years, 4 months ago by
David.
-
AuthorPosts
-
March 21, 2020 at 3:10 am #1201339
Tim
Hello
Following this guide:
https://docs.generatepress.com/article/adding-breadcrumbs/Suggests installing and configuring Yoast SEO for breadcrumbs:
https://yoast.com/help/implement-wordpress-seo-breadcrumbs/and Utilising GP Hooks to place the breadcrumb using a shortcode.
Perhaps the guide needs updating since it was difficult to follow this procedure. Primarily a shortcode from Yoast could not be found.
Instead, it was far easier to add the code snippet offered
add_action( 'generate_after_header', function() { if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb( '<div class="grid-container grid-parent"><p id="breadcrumbs">','</p></div>' ); } } );that places the breadcrumb at
generate_after_header1. Which hook location would place the breadcrumb inside the hero just under the header and before the Page/Post Title ?
2. I prefer to float the breadcrumb right and read RTL. Is there a way to run the breadcrumb labels RTL eg: crumb 3 < crumb 2 < crumb 1 ?
March 21, 2020 at 6:30 am #1201660David
StaffCustomer SupportHi there,
yeah i think we need to revisit the Yoast documentation seeing as they have made it even more difficult to find the shortcode which used to be this
wpseo_breadcrumb– of course it will wrapped in[squarebrackets]which i can’t add here as the site uses Yoast for now.1. Header Elements don’t have Hooks inside them and neither will they accept PHP – but they do accept shortcodes You would need to add the above Shortcode inside the header element.
2. You would need to ask Yoast as GP doesn’t control the breadcrumb output.
March 22, 2020 at 2:37 am #1203003Tim
Hi David
Yes
wpseo_breadcrumbwith surrounding[]does work in a Hook. But I’m failing to see which hook location will place the breadcrumb inside the Hero immediately after the Header.What would be the best practice for doing that ?
Thanks
Tim
March 22, 2020 at 6:27 am #1205091David
StaffCustomer SupportYou would need to add the shortcode inside the Header Element itself.
March 24, 2020 at 4:05 am #1208201Tim
Hi David
Thanks I did get that working, but I’m still hunting for a method to display the crumbs RTL.
March 24, 2020 at 1:07 pm #1208885David
StaffCustomer SupportGlad to hear that – have a chat with RankMath support 🙂
December 20, 2020 at 8:02 am #1588251Rocio
Hi, sorry for my meddling. I would like the breadcrumbs of my theme to load in the hero title. I add the code inside the header element itself and it doesn’t work. Could you help me detect what I am doing wrong?
<?php
if ( function_exists(‘yoast_breadcrumb’) ) {
yoast_breadcrumb( ‘<p id=”breadcrumbs”>’,'</p>’ );
}
?><h1>
{{post_title}}
</h1>December 20, 2020 at 8:11 am #1588266David
StaffCustomer SupportHi there,
Header Elements do not support PHP but they do support shortcodes, Yoast has its own shortcode you can use which is provided here:
https://yoast.com/help/implement-wordpress-seo-breadcrumbs/#pageshortcode
December 20, 2020 at 8:34 am #1588287Rocio
Hello david
Thanks to your help I made it work.
A greeting from Spain
December 20, 2020 at 11:26 am #1588424David
StaffCustomer SupportGlad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.