Bread Crumbs

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>’);} ?>

the site is:

wp.metrocleanonline.com

I want to add them to all pages except the home page.

Hey DAW Digital,

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. :slight_smile:
http://forum.wpbeaverbuilder.com/knowledge-base/theme-action-reference/

Ben

[Content Hidden]

Hey DAW Digital,

You simply need to add the code above to the functions.php file of your child theme. :slight_smile:

Ben

[Content Hidden]

Hi DAW Digital,

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.

https://codex.wordpress.org/Child_Themes

Thanks,
Danny

[Content Hidden]

Hi DAW Digital,

Add the following CSS and this should resolve your alignment issue.

#breadcrumbs {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

Thanks,
Danny

[Content Hidden]

Hey DAW Digital,

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. :slight_smile:

Re the 500 error, do you mind sharing WP admin access as well as FTP access to your site so we can check?

Ben

[Content Hidden]

Hey DAW Digital,

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. :slight_smile:

Ben

[Content Hidden]

Hey DAW Digital,

What hostname should we connect to? As the URL you gave doesn’t work.

Ben

[Content Hidden]

[Content Hidden]

[Content Hidden]

Hi DAW Digital,

I have gone ahead and removed the CSS from your functions.php file. You should now be able to access your site.

Once logged in, load up the Customizer and navigate to the Code > CSS Code and paste the code there.

#breadcrumbs {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

Thanks,
Danny

Hi DAW Digital,

Just checking in to see if your issue is now resolved?

Thanks,
Danny