Reposition breadcrumbs

Community Forums Forums General Discussion Reposition breadcrumbs

This topic is: resolved

Tagged: ,

This topic contains 7 replies, has 3 voices, and was last updated by  braddalton 10 months, 2 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #44377

    mathiasppc
    Participant
    Post count: 27

    I want to reposition my breadcrumbs:

    // Reposition the breadcrumbs
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
    add_action( ‘genesis_before_post_title’, ‘genesis_do_breadcrumbs’ );

    They do not appear on the site when I use the functions above. I`ve tried with several different hooks without any luck.

    Right now they`re showing at the hook ‘genesis_before_loop’

    http://energyinformative.org/
    #44381

    rfmeier
    Participant
    Post count: 517

    Hello,

    Isn’t ‘genesis_before_post_title’ a pre Genesis 2.0 action? Maybe try ‘genesis_before_entry’ or ‘genesis_entry_header’ (bumpt the priority down).

    Hope this helps.


    Ryan Meier – Web Developer @ Solid Interactive
    Twitter

    #44383

    braddalton
    Participant
    Post count: 7452

    I think you might need to add a third parameter for priority positioning when using a hook within the loop to reposition.

    This works:

    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    add_action( 'genesis_before_post_title', 'genesis_do_breadcrumbs', 55 );
    

    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #44395

    mathiasppc
    Participant
    Post count: 27

    Thanks for the quick responses guys. I ended up using the HTML5 markup:

    // Reposition the breadcrumbs

    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’ );
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
    remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_entry_header’, ‘genesis_do_breadcrumbs’ );
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_entry_header’, ‘genesis_post_info’ );

     

    Seems a bit unecessary to use 6 lines to reposition (and change the priority) just to reposition the breadcrumbs - is this really the best way to do it?

    #44399

    rfmeier
    Participant
    Post count: 517

    I wouldn’t think you would have to re-arrange all those actions.

    Try;

    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
    add_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’, 9 );

    Brad might have more insight to this.


    Ryan Meier – Web Developer @ Solid Interactive
    Twitter

    #44402

    mathiasppc
    Participant
    Post count: 27

    Perfect that worked! I wasn`t aware of that functionality

    #44403

    rfmeier
    Participant
    Post count: 517

    You are welcome. Glad I could help.


    Ryan Meier – Web Developer @ Solid Interactive
    Twitter

    #44410

    braddalton
    Participant
    Post count: 7452

    Didn’t realize you’re using HTML 5 sorry.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.