Breadcrumbs on header.php?

HI there,
I was trying to add the Breadcrumbs code on my header.php, but when I do so I can see the code displayed on my site.
This is the code that I’ve got from Seo Yoast

if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('
<p id="breadcrumbs">','</p>
');
}

And here is a link with a bit more information in case is necessary: https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/

My site is: www.therapy.brussels

I deleted the code as it was giving me an error, but I will like to add it somewhere else to be possible.
I know other places that I can use are page.php or single.php but I don’t know exactly where in those files…
Thanks for the help!

Cecilia.

Hello Cecilia,

Looks like your issue requires some coding and testing, this goes beyond our support policy. It’s considered advanced customization.

As an option, you can contact Codeable for this kind of service, or find a freelancer on Upwork.

Kind Regards, Roman.

Hi Roman,
I asked around and everyone is referring me back to “the theme developer”. I even contacted the people from Codeable.
You may check this link which also refers me to you : https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/ I did send this one to you last time.

I know that on page.php I should paste the code under the header, but I don’t know exactly where the header ends (line number…?). Regarding the “testing” you mentioned I will be able to see as soon as I make the changes if it is giving me an error or not and get back to the original version of page.php if necessary.

Under this link you may also check an example about where to paste the code in a different theme (I’m sending it just in case it helps) http://screencast.com/t/PVkwtKbx50m

At least I would like to know where the header ends on page.php

Thanks,

Hello Cecilia,

I have just tried to integrate Breadcrumb NavXT plugin into Astrid theme. Attempt was successful, so I think that other breadcrub plugins should work as well.

I added their code (you can check it below) to the very bottom of header.php file. However, please note that you have to override modified header.php in a child theme to avoid losing modification after theme update.

<div class="breadcrumbs" typeof="BreadcrumbList" vocab="http://schema.org/">
    <?php if(function_exists('bcn_display'))
    {
        bcn_display();
    }?>
</div>

Kind Regards, Roman.

HI Roman,
Thanks for that, but unfortunately I can see the entire code being displayed right under my header :frowning:
Could you please tell me in which line does the header ends on ‘page.php’? So I can try it out there?

And also could you please refer me to any post where it is explained how to set a child theme? As I’m using Astrid right now and I know changes will be deleted by updating the theme.

Thanks a lot! :wink:

Hello Cecilia,

You should add code to the very bottom of header.php file, not page.php.

Here is a link that can help you to better understand child themes:
https://codex.wordpress.org/Child_Themes

Kind Regards, Roman.

Hi Roman,
Sorry for the late reply. I didn’t have time to get into my site earlier.
Thanks for the info! :wink:
I’ll set the child theme soon in order to add the breadcrumbs.

Thanks,

Cecilia.

You are welcome Cecilia,

Please let me know if you need more help.

Kind Regards, Roman.

    @ceciliaaltieri:
could you ever fix that problem ? I am having a similar issue.