• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Reposition Breadcrumbs On Single Posts In Genesis

This template enables you to remove the default position of the breadcrumbs and add them back in any Genesis hook position.

In this case, we use the genesis_after_entry_content hook however you can use any genesis hook.

#Installation

Create a new file named single.php in your child themes root directory and add the following PHP code to the file.

#Conditionally Reposition Breadcrumbs

You could also use PHP code in your child themes functions.php file to conditionally remove and add back your breadcrumbs in any hook position like this :

add_action( 'genesis_before_loop', 'reposition_breadcrumbs_conditionally', 5 );
function reposition_breadcrumbs_conditionally() {
if ( is_singular( 'post' ) ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_entry_content', 'genesis_do_breadcrumbs' );
    }
}

Change the genesis_after_entry_content hook to any other genesis hook.

#Reposition Breadcrumbs After Header

add_action( 'genesis_meta', 'reposition_breadcrumbs_conditionally', 5 );
function reposition_breadcrumbs_conditionally() {

if ( is_singular( 'post' ) ) {

remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );

}
}

If you’re using the Genesis Sample child theme, you’ll also need to add CSS to display the breadcrumbs below the fixed header.

.breadcrumb {
    margin-top: 40px;
}

Related Code Snippets

  • Add Blog To Breadcrumbs On Single Posts In Genesis
  • Remove Category From Breadcrumbs In Single Posts Using Genesis

Breadcrumbs

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags