Archived topic
Breadcrumb NavXT
10 replies · Started by Kévin on March 11, 2020
Hi,
I want to add Breacrumb NavXT to my website but I don't know how to change the position.
I see a code to add on the functions.php file on that forum (https://wordpress.org/support/topic/change-position-of-breadcrumb-using-breadcrumb-navxt/) but it's not really the place i want it to be.
See on the img here: https://ibb.co/gSvFxx9
Hi there,
this visual guide will help - it shows you the various hooks available and their position:
https://docs.generatepress.com/article/hooks-visual-guide/
And you can use the Hook Element to add the HTML / PHP that user provides in his original topic:
https://docs.generatepress.com/article/hooks-element-overview/
Please ensure you check Execute PHP in the Hook Element.
Hey,
I didn't know it was a hooks visual guide. It will help a lot. Thank you.
Btw, I did it, but i changed the margin-top of the breadcrumb to be upper. It's nice on all the page, apart on the home page. I think it's because the breadcrumb is hidden.
How can i fix this ?
Thank's again.
Kévin
In the Hook Element > Display Rules you can Exclude the Front Page
Hi David,
I did it (element before_main_content) and exclude Front page, but nothing change.
This part of generatepress is new for me. I don't really understand what I have to do.
Thank's
I succeed by doing a "padding-top" on the page, but it's not the trick that you told me to do.
Can you explain me better how to exlude the Breadcrumbs Navxt on front page with the hooks.
I have a child theme and put the code below on the functions.php page.
add_action( 'generate_before_main_content', 'tu_breadcrumbs' );
function tu_breadcrumbs() {
?>
<?php
}
Can you tell how did I have to do ?
Hi there,
If you want to use that code while excluding the front page, you would do this:
add_action( 'generate_before_main_content', function() {
if ( function_exists( 'bcn_display' ) && ! is_front_page() ) {
bcn_display();
}
} );
Hello Tom,
Thank's again. And if I want to use hook. What do I have to put in here ?
Img here: https://imgur.com/Iu417U2
After your response, I will close the topic. It's juste to understand how to use hook and where to place the code.
If you're going to use a Hook Element, this would be your content:
<?php
if ( function_exists( 'bcn_display' ) ) {
bcn_display();
}
?>
Then in Display Rules, you would choose "Entire Site", and then you would choose "Front Page" in the exclude option.
Ok, thank's !
That's what i wanted to know.
Hace a nice week-end !
Kévin
Thanks, you too! :)