Trying to get next post url, custom post type is portfolio. already have tag in posts in this post type. "star".
I was trying to get url for the next post by time. and should have the same tag.
anybody know that how possible to get that.
I have found that code which is able to get
$args=array(
'portfolio-tag' => 'loop1',
'showposts'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo '5 recent Posts with tag1';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
But i need url just for next post by time, if i am on fourth detail post, how can i get 5th post url. so it will be next in this collection.