• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Conditionally loading Breadcrumbs

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Conditionally loading Breadcrumbs

This topic is: not resolved

Tagged: breadcrumbs

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 3 months ago by lvvvvvl.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 12, 2018 at 4:31 am #221630
    lvvvvvl
    Participant

    Hey,

    I've been toying around with a child theme and trying to relocate the breadcrumbs from the genesis_after_header to the genesis_after_entry_content. I can easily relocate it using:

    // Repositions the breadcrumbs.
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    add_action( 'genesis_after_entry_content', 'genesis_do_breadcrumbs', 2 );

    But the only problem with that is that it globally relocates it throughout the site, including the archieves for categories/tags which results in multiple breadcrumbs (one at the bottom of each Entry Excerpt of the archive).

    Ideally I would have liked to keep the breacrumbs in the header for the category/tag taxonomies and load it in the genesis_after_entry_content for the single posts but that seems beyond my abilities.

    So I've chopped together a code that conditionally loads it in single posts and no where else though it renders multiple bread crumbs within the single post (one where I want in the after_entry but one in the before_entry area):

    // Repositions the breadcrumbs.
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs', 1 );
    function remove_breadcrumbs_conditionally() {
    if ( is_single() ) {
        
        add_action( 'genesis_after_entry_content', 'genesis_do_breadcrumbs', 90 );
    	
        }
    }
    add_action( 'genesis_after_entry_content', 'remove_breadcrumbs_conditionally' );

    Any suggestions of what I may be doing wrong?

    Thank you

    July 12, 2018 at 4:46 am #221631
    Brad Dalton
    Participant

    This code enables you to reposition the breadcrumbs on single posts.


    Tutorials for StudioPress Themes.

    July 12, 2018 at 8:39 pm #221649
    lvvvvvl
    Participant

    You're a legend, for some reason editing the single.php didn't even cross my mind too absorbed in the complicated method. Thank you!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble