Archived topic
Adding Breadcrumbs
15 replies · Started by Mitch and Justine on April 29, 2020
We just tried to add breadcrumbs with the following steps:
1) Creating a hook element
2) Adding in this short code as laid out in the Yoast breadcrumb article (see below)
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
3) Enabling breadcrumbs through our Yoast plugin
Can you confirm that this is the right code to add in because we could see part of the actual code on the front end of our website. We followed these two articles:
https://docs.generatepress.com/article/adding-breadcrumbs/
https://yoast.com/help/implement-wordpress-seo-breadcrumbs/
Hi there,
Can you confirm that execute PHP is checked in the hook element?
Let me know :)
Yes, we did check that box. I tried re-doing it this morning, and this is the error message I'm getting:
Parse error: syntax error, unexpected 'id' (T_STRING), expecting ')' in /home/customer/www/brokebankvegan.com/public_html/wp-content/plugins/gp-premium/elements/class-hooks.php(180) : eval()'d code on line 3
I always find the shortcode method much easier:
https://www.screencast.com/t/yhh6JYALXRgM
Can you try that instead and make sure to check to execute shortcode this time?
So, will we have to insert this short code on every post that we do? Or should we insert this short code in the hook element?
It would be with a hook. Try following the step by step guide here:
https://docs.generatepress.com/article/adding-breadcrumbs/#using-hooks-element
That's the article we had followed before. So instead of adding the code generated by Yoast, add in this code?
[wpseo_breadcrumb]
Okay, never mind that short code worked! Thank you!
No problem :)
Hi Leo,
I have tried to follow your instruction but or it doesn't work or I am doing something wrong.
https://www.dropbox.com/s/42wsupr5ufsib19/Screenshot%202020-07-22%20at%2015.37.03.png?dl=0
https://www.dropbox.com/s/1b5zxs5ib8ehfp1/Screenshot%202020-07-22%20at%2015.35.14.png?dl=0
Regards
Can you try the shortcode method as suggested here?
https://generatepress.com/forums/topic/adding-breadcrumbs-4/#post-1263482
Hi Leo,
I have done your procedure but nothing
https://www.dropbox.com/s/7wqcc4bfmvu2gih/Screenshot%202020-07-22%20at%2016.33.55.png?dl=0
https://www.dropbox.com/s/mhmlz6v1jgxgd9i/Screenshot%202020-07-22%20at%2016.33.45.png?dl=0
Regards
Enrico
That is not what my screenshot is showing here:
https://generatepress.com/forums/topic/adding-breadcrumbs-4/#post-1263482
Are you able to see that screenshot?
It's showing the shortcode option.
You can also copy the shortcode from this page:
https://yoast.com/help/implement-wordpress-seo-breadcrumbs/
Check the shortcode under the Implement breadcrumbs on pages using a shortcode section.
Hi. I am doing excatly this but no breadcrumbs are showing on the front-end.