Archived topic
Where do I insert code for Yoast BreadCrumbs
3 replies · Started by Jude on August 12, 2019
I need to insert the code below in my theme to enable Yoast Breadcrumbs as stated in this article;
https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/.
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
I want to insert the code at this point sitewide https://prnt.sc/orr04c
Thank you
Hi there,
you can insert it using the hook element.
https://docs.generatepress.com/article/hooks-element-overview/
The before_content hook will place it there. This visual guide shows where the main template hooks are:
Hello David
When I will put the Yoast breadcrumb code (mention below) in the Hook, am I need to click on execute PHP option or not?
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
Hi there,
yes, Execute PHP is required.