Community Forums › Forums › Archived Forums › Design Tips and Tricks › NextPage location – simple hooks
Tagged: nextpage
- This topic has 8 replies, 2 voices, and was last updated 10 years, 8 months ago by moneyfunk.
-
AuthorPosts
-
April 15, 2013 at 9:11 pm #35690moneyfunkMember
Using the <!–nextpage–> tag in my post adds the pagination after the content, but also after my add-post-footer & nrelate plugin.
http://www.oatmealinmybowl.com/the-kitchen/hamburger-rice-soup/
How would I use simple hooks to move the posts pagination function reference:
wp_link_pages($args = '')
above the plugin content and show right after the posts?
Thank you.
April 15, 2013 at 10:49 pm #35698Brad DaltonParticipantThere is no single post navigation in your theme by default.
The next page tag is used to break up larger posts and not for single post navigation. http://codex.wordpress.org/Styling_Page-Links
The hook location for single post navigation is named the genesis_after_post_content hook as you can see in this visual hook reference.
You might find this code useful:
Otherwise David Decker has a plugin which is a bit different but excellent for post navigation. http://wordpress.org/extend/plugins/genesis-single-post-navigation/
You'll also find there's an after widget already included hooked into the genesis_after_post_content hook so you'll need to use another hook and add a third parameter to the code which is lower then the default of 10. I have added that to the code above.
April 15, 2013 at 10:56 pm #35700Brad DaltonParticipantThe above code goes at the end of your child themes functions.php file and not in the simple hooks plugin.
April 15, 2013 at 11:03 pm #35702moneyfunkMemberBrad - thank you very much for your help. And I will definitely use this reference when I have the time to add more to my blog.
But I may be wording it wrong - I am trying to break up a long post into multiple pages by using theΒ Β <!–nextpage–>Β tag. If you look after the nRelate content you will see it says, "Pages: 1, 2". I am looking to move that above the nRelate footer and the Add-Post-Footer content.
http://www.oatmealinmybowl.com/the-kitchen/hamburger-rice-soup/
April 16, 2013 at 12:07 am #35708Brad DaltonParticipantYes i see now. Its not really a long post though so maybe you don't need it.
You might have to change the hook for nrelate so it loads after the next page links.
August 6, 2013 at 10:59 am #54398moneyfunkMemberBrad - do you know how I would change the hook for nrelate? And thank you for your help. π
August 6, 2013 at 11:14 am #54402moneyfunkMemberNev mind. figured it out! π Yay!
August 6, 2013 at 11:14 am #54403Brad DaltonParticipantThere's 4 ways to do that:
1. Use the nRelate template tag in a custom function with Genesis hook.
2. Use the nRelate shortcode in a custom function with Genesis hook.
3. Use the nRelate widget in a custom widget.
4. Use the nRelate shortcode in a custom widget and add support for shortcodes in widgets.
August 6, 2013 at 11:16 am #54405moneyfunkMemberAh! you're quick. i ended up using the shortcode and hooking it at the genesis_after_post_content Hook
<?php if (is_single()) {?> [nrelate-related] <?php } ?>
then went into the nrelate settings and had to uncheck both
- Top of post (Automatic)
- Bottom of post (Automatic)
and it worked. π
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.