"remove_action" non-functional in Genesis 2.0

Community Forums Forums General Discussion "remove_action" non-functional in Genesis 2.0

This topic is: not resolved

Tagged: , ,

This topic contains 10 replies, has 6 voices, and was last updated by  Efrat 1 year, 4 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #54761

    taylorishere
    Participant
    Post count: 8

    For example:

    remove_action( 'genesis_entry_header', 'genesis_post_info' );

    Does not work.

    #54803

    Robert Neu
    Participant
    Post count: 90

    Are you sure you’ve activated HTML5 correctly? Make sure you add

    add_theme_support( 'html5' );

    to your functions.php file. If you’re sure HTML5 has been activated correctly, try this:

    //* Remove the entry meta in the entry header (requires HTML5 theme support)
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );

    Co-Founder of Audit WP, a WordPress SEO audit service and Flagship, a new WordPress theme company launching soon!

    #54805

    taylorishere
    Participant
    Post count: 8

    Why do I have to now include (12) at the end? This used to not be the case.

    The 12 fixed it.

    #54812

    Robert Neu
    Participant
    Post count: 90

    It was part of the updates in the final version of 2.0. I’m pretty sure the changes they made were to ensure that sections that were merged into one hook would still be hooked in the same order that they were in the XHTML version.

    Gary Jones has a book that outlines all the changes in the latest version. If you’re interested in learning more, you can check it out here: http://gamajo.com/changes


    Co-Founder of Audit WP, a WordPress SEO audit service and Flagship, a new WordPress theme company launching soon!

    #54832

    Gary Jones
    Moderator
    Post count: 693

    Thanks for the shout out Rob!

    The reasoning for the priorities isn’t quite right, but I’ve just posted http://www.studiopress.com/forums/topic/why-you-shouldnt-feat-updating-to-genesis-2-0-from-1-9-but-should-from-2-0rc2/#post-54831 which should explain the reason for the change, and why it was important to get it right now.


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    #55028

    neilc
    Participant
    Post count: 33

    This doesn’t work for me using Genesis 2.0 and its accompanying Genesis Sample theme.

    Both page and post titles appear as before?

    #55032

    Efrat
    Participant
    Post count: 8

    On the same subject, can someone help me understand why this conversion does not work (it is in Streamline theme (functions.php)):

    /** Relocate the post info function */
    Old (which I’ve removed):
    remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
    add_action( ‘genesis_before_post’, ‘genesis_post_info’ );

    New (which I’ve added):
    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 12 );
    add_action( ‘genesis_before_entry’, ‘genesis_post_info’ );

    Please help…
    Thanks

    #55178

    Gary Jones
    Moderator
    Post count: 693

    @neilc – without any code or URL to see I can’t offer any help. Start a new thread with as much info as possible – the URL, what you’ve tried, the end result you’re aiming for, etc. (Define “doesn’t work”)

    @Efrat – does the existing post info get removed? Does the new one just not get added? (Define “does not work”).


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    #55179

    Efrat
    Participant
    Post count: 8

    Hi @Gary,

    After the change, the post info got removed (which means that the remove_action works) but it was not added back (which means that the add_action does not work)…

    thanks much

    #56890

    Joe Thomas
    Participant
    Post count: 13

    @Efrat: What you have…

    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    add_action( ‘genesis_before_entry’, ‘genesis_post_info’ );

    worked for me.

    If you can’t get it to work, try keeping it within the entry header (but still above the post title) by doing this instead:

    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    add_action( 'genesis_entry_header', 'genesis_do_post_title', 7 );
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    add_action( 'genesis_entry_header', 'genesis_post_info', 6 );

    This

    • 1. Gives the post title a priority of 7
    • 2. changes the priority of the post info to 6

    *Note: With this change, you may have to alter your CSS to target the post info (i.e., .entry-meta), since it will now be inside the entry instead of outside of it as before.


    Owner/Web Developer at LocalBoost.

    • This reply was modified 1 year, 4 months ago by  Joe Thomas.
    • This reply was modified 1 year, 4 months ago by  Joe Thomas.
    • This reply was modified 1 year, 4 months ago by  Joe Thomas.
    • This reply was modified 1 year, 4 months ago by  Joe Thomas.
    #57125

    Efrat
    Participant
    Post count: 8

    Hi Joe,

    Thank you so much for your help.
    Nick (from StudioPress) helped me with this issue and you won’t believe what is the reason for this issue:
    The quotation marks in the add_action (‘) declaration are not the standard quotation characters (‘)….it should have thrown a php error but it haven’t..
    I copied the add_action from a web page (can’t remember from where) and these characters were copied from there as well.

    Thanks

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

You must be logged in to reply to this topic.