Archived topic
Add Breadcumbs below main menu
7 replies · Started by Yann on May 10, 2021
Hi,
I would like to add the breadcumbs Yoast below my main menu (in the <header> of each page / product / and all type of page)
How can I do that by editing child-theme ?
I tried some things but nothing works...
I think it's inside inc > structure > header.php
Thanks
Hi there,
this article explains how to add Yoast breadcrumbs to your site:
https://docs.generatepress.com/article/adding-breadcrumbs/#using-hooks-element
On point 3 - you can change the Hook to after_header
If the placement is different to that - then share a link to your site so i can see the layout.
Hi,
There is : https://demo.lacartepassce.fr
Thanks
Did you try the method i mentioned ?
Moving it directly below your Menu Items may cause some issues as the Breadcrumbs have links which could interfere when a sub menu is opened over the top of them.
Hi,
Yes i tried it, it works but i need to customise the CSS and I don't know how to do, there is no class on the span tag
If you use this code in your hook:
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<div class="grid-container grid-parent"><p id="breadcrumbs">','</p></div>' );
}
Then it will output the content within a grid-container div ( which sets its max width to match the customizer container width) and <p> tag with a unique ID you can target.
It works, thanks a lot !
Awesome - glad to hear that!