Community Forums › Forums › Archived Forums › Design Tips and Tricks › Some Help Hooking With New Genesis 2 Markup
Tagged: genesis 2 hooks, genesis 2 new hooks
- This topic has 5 replies, 2 voices, and was last updated 11 years, 5 months ago by Marcy.
-
AuthorPosts
-
July 26, 2013 at 1:02 pm #52635AlessandraMember
Hello, Guys!
I was waiting for an update of the genesis simples hooks plugin, but seems like its gonna take a while...
I had somethings hooked with that plugin before i updated to genesis 2.0.
With this update i lost my hooks since many of them changed.
Now i need to do it through my functions.php i guess, but the thing is that i am having a very hard time with it. I already consulted a lot of tutorials and videos but i get no result at all... =/
The content i used to have hooked with the genesis simple hooks is this, and it goes into the old genesis_after_post_content Hook:
<?php if (is_single()) { ?> <div class="prev_next"> Contentet here </div> <div class="share-and-subscribe"> Content goes here </div> <?php } elseif ( is_page() ) { ?> <div class="share-and-subscribe"> content goes here </div> <?php } ?>
Would someone please help me out with this?
Best regards.
July 26, 2013 at 3:04 pm #52677MarcyParticipantYou can try using the 'genesis_entry_footer' hook instead of 'genesis_after_post_content'
You could also try 'genesis_after_entry' but that will be a bit farther below.My guess is that the plugin with updates will be released as soon as Genesis 2.0 is.
So you would use this:
add_action('genesis_entry_footer', 'custom_entry_footer');
function custom_entry_footer() {
[ your content here ]
}
Marcy | Amethyst Website Design | Twitter
July 26, 2013 at 10:55 pm #52730AlessandraMemberThank you so much, Marcy!
That worked like a charm!
I just had to change the hook for posts because inside genesis_entry_footer i got the content also showing bellow the excerpts on the home page when i just want this content available bellow the post content inside itself.
I used:
add_action( 'genesis_before_comments', 'genesis_before_comments_custom' ); function genesis_before_comments_custom() { if ( is_single() ) ?> <div> [CONTENT] </div> <?php }
And tried to replicate it to also show this content on pages but with a slightly different content with this:
add_action( 'genesis_after_endwhile', 'genesis_after_endwhile_custom' ); function genesis_after_endwhile_custom() { if ( is_page() ) ?> <div> [CONTENT2] </div> <?php }
But i got this last piece of content2 also showing on posts.... =/
Am i doing something stupid?
July 27, 2013 at 5:45 pm #52879MarcyParticipantYou're doing great! Conditionals are tricky. 🙂
I think for CONTENT2, this line should be:<?php function genesis_after_endwhile_custom() { if ( ( is_page() ) && (!is_single() )) ?>
This means if it's a page and not single, so that should keep it from showing on your posts.
Marcy | Amethyst Website Design | Twitter
July 27, 2013 at 6:01 pm #52881AlessandraMemberThanks in abundance, Marcy!
You're my Queen from now on! =}
You made it work perfectly!
I S2 You!
July 28, 2013 at 1:22 pm #52990MarcyParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.