- This topic has 9 replies, 4 voices, and was last updated 8 years, 1 month ago by
Leo.
-
AuthorPosts
-
July 9, 2017 at 1:41 pm #346591
Harvey
As you’ve suggested, I’ve disabled executing PHP execution from the Dashboard. I had the Yoast Breadcrumb code in GP Hooks after the header. Moving it to functions.php didn’t work (as Yoast said it wouldn’t). I’ve been thru the GP docs and searched the GP suppport forum, and I’m still unsure where to put it. I’d rather not copy header.php into the child theme folder in case it gets updated. Any suggestions?
Harvey
July 9, 2017 at 9:01 pm #346748Tom
Lead DeveloperLead DeveloperHi Harvey,
Try this:
add_action( 'generate_after_header', 'tu_add_yoast_bc' ); function tu_add_yoast_bc() { ?> Your Yoast breadcrumbs code in here <?php }This can go in your child theme functions.php, or a custom plugin.
July 10, 2017 at 10:45 am #347138Harvey
Thank you so much. It’s good someone knows all the d**n function calls!
I’ve followed your advice — don’t see the breadcrumbs yet. Will play around a bit and contact you again if necessary.
Harvey
July 10, 2017 at 11:22 am #347166Tom
Lead DeveloperLead DeveloperSounds good, I’ll be here 🙂
January 9, 2018 at 9:44 am #466838Gabriele
Hi there,
I’m trying to do the same but there is something wrong with my code:add_action( 'generate_after_header', 'dev_add_yoast_breadcrumbs' ); function dev_add_yoast_breadcrumbs() { ?> if ( function_exists('yoast_breadcrumb') && ! is_front_page() ) { yoast_breadcrumb( '<p id=”breadcrumbs”>','</p>' ); } <?php ?> endif; <?php }Please can you help me?
January 9, 2018 at 1:00 pm #466954Leo
StaffCustomer SupportWhat is wrong?
January 9, 2018 at 2:36 pm #467004Gabriele
I don’t know… maybe something in the php syntax, code snippets don’t like it 🙂
January 9, 2018 at 5:32 pm #467122Leo
StaffCustomer SupportCan you open a new topic and specify your condition for the breadcrumb?
Like do you want them on every page?
Thanks!
January 9, 2018 at 5:50 pm #467136Gabriele
The condition is already correct, the problem is simply the php syntax (brackets or something like that).
I’m not a coder so I have made some mistake but I don’t know where…January 9, 2018 at 7:50 pm #467197Leo
StaffCustomer SupportTry the code here in Appearance > GP Hooks > After Header:
https://generatepress.com/forums/topic/trying-to-enable-breadcrumbs-yoast-seo/#post-416405and make sure execute PHP is checked.
-
AuthorPosts
- You must be logged in to reply to this topic.