Advanced Custom Sort with Next and Prev using get_adjacent
-
Hi there,
I hope you can answer this soon..
You see, what I’m trying to do is to have a next and previous link of the post that would work using ACS query. However, when I do that with get_adjacent post which I’m using, it’s not getting the query if it’s within the loop.
The code used is this
for next:
< ? php echo get_permalink(get_adjacent_post(false, “”,true)) ; ? >for prev:
< ? php echo get_permalink(get_adjacent_post(false, “”,false)) ; ? >I’m using it because I kind of need to get the permalink URLS of each post that comes next and on previous so I can add my class which is needed within (ie < a href=” ” class= “class here ” > </ a> )
I can’t seem to make it work even when my query is within the loop
< ?php $acs->query_posts(array(‘group_name’ => ‘mygroup’, ‘posts_per_page’ => 9, ‘paged’ => $paged)); ? >
< ?php if (have_posts()) : while (have_posts()) : the_post(); ? >…. (cont)This is the code I’m using with my other page templates..(above this line)
Note that I add spaces so codes can be viewed. Not familiar with posting here much ^u^
- The topic ‘Advanced Custom Sort with Next and Prev using get_adjacent’ is closed to new replies.