- This topic has 10 replies, 3 voices, and was last updated 4 years, 1 month ago by Tom.
-
AuthorPosts
-
March 11, 2020 at 5:56 am #1191745Kévin
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
March 11, 2020 at 6:09 am #1191760DavidStaffCustomer SupportHi 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.
March 11, 2020 at 6:39 am #1191794KévinHey,
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
March 11, 2020 at 7:34 am #1192003DavidStaffCustomer SupportIn the Hook Element > Display Rules you can Exclude the Front Page
March 11, 2020 at 10:26 am #1192157KévinHi 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
March 11, 2020 at 1:51 pm #1192309KévinI 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 if(function_exists(‘bcn_display’))
{
bcn_display();
}?><?php
}Can you tell how did I have to do ?
March 11, 2020 at 4:22 pm #1192386TomLead DeveloperLead DeveloperHi 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(); } } );
March 12, 2020 at 10:36 am #1193159KévinHello 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.
March 12, 2020 at 6:54 pm #1193379TomLead DeveloperLead DeveloperIf 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.
March 13, 2020 at 2:38 am #1193556KévinOk, thank’s !
That’s what i wanted to know.
Hace a nice week-end !
Kévin
March 13, 2020 at 9:34 am #1194038TomLead DeveloperLead DeveloperThanks, you too! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.