How to add next and previous links to post

Premium BuddyPress WordPress theme perfect for venue, music brand or community music website.
GK User
Sat Mar 01, 2014 1:38 pm
I would like to add a navigation into a post to get to the next and previous post of the same category.
I added the tags
Code: Select all
<?php previous_post(); ?>    <?php next_post(); ?>
in the content.php,

Question:
1. Where do I have to add them, so that they appear only AFTER calling the whole post with the "read more" button?
2. I'm not able to get the tag "posts_nav_link" working
3. there is a tag
Code: Select all
<?php gk_post_links(); ?>
in the content.php. Is this the same, how can I activate them?
User avatar
Senior Boarder

GK User
Mon Mar 03, 2014 10:22 am
Hi,

gk_post_links is for displaying post pagination by default. Are you sure that you correctly insert <!--nextpage--> tag into posts (use text editor and for sure type this tag, don't copy it from e.g. another website).

Please don't use previous_post() funciton - it's deprecated, use these functions instead (in content.php file, before gk_post_fields function):
Code: Select all
<?php previous_post_link(); ?>   
<?php next_post_link(); ?>
User avatar
Moderator

GK User
Sun Mar 09, 2014 1:54 pm
Thanks Piotr,
previous/next_post_link works fine.
Is there any possibility to set this link by default site wide with the theme design? I'm not too familiar with the intagration of a style to a php function...

I do not use <!--nextpage-->, I prefer <!--more-->
User avatar
Senior Boarder

GK User
Mon Mar 10, 2014 8:45 am
What exactly do you want to do with these links? (previous/next), Could you provide an URL to your example post (here or via PM) and then I'll try to help you to add styles..
User avatar
Moderator

GK User
Tue Mar 11, 2014 5:01 pm
Thank you; I wanted to add the possibility to go back to the previous post of the same category/next post same category directly out of the individual post.
I added
Code: Select all
<p><?php previous_post_link('%link', 'Vorheriger Beitrag', TRUE); ?>  |   
<?php next_post_link('%link', 'N&auml;chster Beitrag', TRUE); ?></p>

Problem solved, except the style, but this is no problem so far.

http://www.wiese-eg.de

Cheers
Tobias
User avatar
Senior Boarder

GK User
Wed Mar 12, 2014 9:36 am
You can add this code to css/override.css file to align "next post" to the right:

Code: Select all
.content a[rel="next"] {
   float: right;
}
User avatar
Moderator

GK User
Wed Mar 12, 2014 5:27 pm
Great! Thank you
User avatar
Senior Boarder


cron