Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can I use a hook for this?
- This topic has 8 replies, 3 voices, and was last updated 10 years, 2 months ago by mrhiking.
-
AuthorPosts
-
January 12, 2014 at 8:52 am #84762mrhikingMember
I have Facebook and Email share buttons that I want to show up as the first line in my content (entry).
I would like to automatically add this via a hook, but can't seem to do it.
Here is a post where I manually added it to the content.
http://faithfeeder.com/louie-giglio-will-leave-speechless-indescribable/Any idea if I can automatically add that via a hook?
Thanks!
http://faithfeeder.com/louie-giglio-will-leave-speechless-indescribable/
- MikeJanuary 12, 2014 at 3:03 pm #84817RobinMemberYes, you should be able to use a hook for it. If I'm not sure about a hook, this Genesis Visual Hooks guide is pretty awesome. I'd guess you just want genesis_entry_content, but you may have to add a priority number to your action to make sure it runs before the content itself does. A lower number gets run before a higher number.
HTH
I do the best I can with what I’ve got. (say hey on twitter)
January 12, 2014 at 9:38 pm #84899mrhikingMemberHi Robin -
Thanks for the reply. How/where do I put the lower number?
Here's my code I'm using in the Simple Hooks plugin:
<?php if( is_single() ) { ?> <div align="center"><a class="addthis_button_facebook"><img alt="" src="http://faithfeeder.com/wp-content/uploads/2014/01/facebook4.png" /></a> <a class="addthis_button_email"><img src="http://faithfeeder.com/wp-content/uploads/2014/01/email1.png" /></a></div> <div style="clear: both;"></div> </div> <?php } ?>
January 12, 2014 at 9:44 pm #84902mrhikingMemberI want to add the hook after the post title. I think that's my problem. I don't think I can hook there.
http://www.screencast.com/t/9h2TGthETTrJanuary 13, 2014 at 2:21 am #84927Brad DaltonParticipantJanuary 13, 2014 at 12:17 pm #84996mrhikingMemberBrad - You are the man!!! Thanks so much. Works great. Work in progress, but here's a page I implemented it on. http://faithfeeder.com/dads-letter-son-will-make-cry/
January 13, 2014 at 12:34 pm #85000mrhikingMemberTrying to replicate this under the post content, but not working. Here's my code
genesis_register_sidebar( array( 'id' => 'after-post-content', 'name' => __( 'After Post Content', 'eleven40' ), 'description' => __( 'This is the after post content widget area.', 'eleven40' ), ) ); add_action('genesis_after_post_content', 'after_post_content_widget', 11 ); function after_post_content_widget() { if ( is_singular( 'post' ) ) genesis_widget_area( 'after-post-content', array( 'before' => '<div class="after-post-content widget-area">', 'after' => '</div>', ) ); }
January 13, 2014 at 3:08 pm #85045RobinMemberSince your theme is an HTML5 theme, the genesis_after_post_content hook doesn't exist. You need to either use genesis_entry_content with a large number so it loads after your content, or use genesis_entry_footer with a small number. (source: Visual Hook Guide)
Great link, Brad--thanks for sharing it!
I do the best I can with what I’ve got. (say hey on twitter)
January 13, 2014 at 3:30 pm #85052mrhikingMemberThanks Robin! That worked great.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.