Site logo

Archived topic

Breadcrumb NavXT

10 replies · Started by Kévin on March 11, 2020

Viewing posts 1–11 of 11

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! :)

This archived topic is closed to new replies.