• ab2211

    (@ab2211)


    Hello!

    I disabled the breadcrumbs, because they appear after the title, when I choose the title as backgroundimage. I want the breacrumbs appear directly under the headerimage. I use OceanWp & elementor. So, how can I do this?

    • This topic was modified 7 years ago by ab2211.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ab2211

    (@ab2211)

    Ok, I found a shortcode to do this: [oceanwp_breadcrumb]

    Amit Singh

    (@apprimit)

    Glad to hear that you found it.

    Thread Starter ab2211

    (@ab2211)

    Disadvantage: I need to paste this snippet in every single page.

    Amit Singh

    (@apprimit)

    No need to add shortcode each time. Add the below code to the child theme’s functions.php file to add the breadcrumb above the title –

    function prefix_oceanwp_breadcrumb() {
            echo do_shortcode( '[oceanwp_breadcrumb]' );
    }
    add_action('ocean_before_content_inner','prefix_oceanwp_breadcrumb');
    Thread Starter ab2211

    (@ab2211)

    Ok, thanks, interesting. But, what if I want the breadcrumbs just on some pages?

    Amit Singh

    (@apprimit)

    You can add a condition in the code like the below code –

    function prefix_oceanwp_breadcrumb() {
       if (is_page( array( 42, 54, 6 ) ) ) {
            echo do_shortcode( '[oceanwp_breadcrumb]' );
       }
    }
    add_action('ocean_before_content_inner','prefix_oceanwp_breadcrumb');

    See all conditional tags – https://codex.wordpress.org/Conditional_Tags

    Thread Starter ab2211

    (@ab2211)

    Wow, that is very nice!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Breadcrumbs under header’ is closed to new replies.