I found a bunch of stuff on trying to add breadcrumbs, but nothing straight forward. I have Yoast SEO installed but can’t figure out where to put their code to display below the header.
I have a margin available on my sub pages for breadcrumbs, but need to understand where to put the code.
<?php if ( function_exists(‘yoast_breadcrumb’) )
{yoast_breadcrumb(’<p id=“breadcrumbs”>’,’</p>’);} ?>
Try adding the code below to your functions.php file and see if it’s what you’re looking for.
/* Add Yoast SEO breadcrumbs */
function bb_breadcrumb() {
if ( function_exists('yoast_breadcrumb') && !is_front_page() ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
add_action( 'fl_content_open' , 'bb_breadcrumb' );
Edit: Sorry, my reply was sent a bit early. Basically, what we’re doing here is that we’re adding a new condition to the if statement to check if the page is your homepage. We’re also adding the function to the fl_content_open action of our theme which fires after the opening content div tag. More info on action hooks on the link below. http://forum.wpbeaverbuilder.com/knowledge-base/theme-action-reference/
The functions.php file is located in your child theme. You can locate this inside your WordPress Admin Dashboard > Appearance > Editor. From here, select your child theme and on the right hand side, should be all the child themes files listed. Click the functions.php file and then add the code Ben provided above.
I have also provided you with a link to the WordPress Codex which goes into detail about child themes. As you wasn’t sure where the functions.php file, you should fine this article useful.
Sorry, we should have been a bit clearer. The CSS code above provided by Danny, and any other CSS codes, goes to the Appearance > Customize > Code > CSS Code section. What you’re trying to do is actually a bit complex.
Re the 500 error, do you mind sharing WP admin access as well as FTP access to your site so we can check?
For errors like this, the only way to get back to your site is to remove the incorrect code from the functions.php file. And the only way to access that now is via FTP. Let us know once you have those info so we can take a look.