Community Forums › Forums › Archived Forums › General Discussion › "remove_action" non-functional in Genesis 2.0
- This topic has 10 replies, 6 voices, and was last updated 10 years, 3 months ago by
Efrat.
-
AuthorPosts
-
August 7, 2013 at 6:09 pm #54761
taylorishere
MemberFor example:
remove_action( 'genesis_entry_header', 'genesis_post_info' );
Does not work.
August 7, 2013 at 9:08 pm #54803Robert Neu
MemberAre 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 );
August 7, 2013 at 9:17 pm #54805taylorishere
MemberWhy do I have to now include (12) at the end? This used to not be the case.
The 12 fixed it.
August 7, 2013 at 9:31 pm #54812Robert Neu
MemberIt 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
August 8, 2013 at 1:55 am #54832Gary Jones
MemberThanks for the shout out Rob!
The reasoning for the priorities isn't quite right, but I've just posted http://www.studiopress.community/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.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
August 8, 2013 at 12:36 pm #55028neilc
MemberThis doesn't work for me using Genesis 2.0 and its accompanying Genesis Sample theme.
Both page and post titles appear as before?
August 8, 2013 at 1:03 pm #55032Efrat
MemberOn 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...
ThanksAugust 9, 2013 at 2:22 am #55178Gary Jones
Member@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").
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
August 9, 2013 at 2:32 am #55179Efrat
MemberHi @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
August 16, 2013 at 2:45 pm #56890Joe Thomas
Member@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.
August 17, 2013 at 11:54 pm #57125Efrat
MemberHi 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
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.