I am using the following functions in my single.php file to display links to Previous and Next posts:
get_next_post();
get_previous_post();
I store them in 2 variables:
$next_post = get_next_post();
$prev_post = get_previous_post();
and outputting them at the bottom of the page using get_permalink:
$next_post_url = get_permalink( $next_post->ID );
<a href="<?php echo $next_post_url; ?>"> Next </a>
and
$prev_post_url = get_permalink( $prev_post->ID );
<a href="<?php echo $prev_post_url; ?>"> Previous </a>
It does work fine and gives me the "previous" and "next" posts However, it includes all the posts in my blog including all post formats: gallery, images, quote, aside etc etc
Id like to exclude them from being included in the loop because they don't have content. their only purpose in my blog is to show quote or image or something else but the only "content" post which is important is the standard post format
Anyone knows how to accomplish that using my code? (preferably) or different code is better
Thanks
it includes all the posts
) from happening you need to make different category for posts that are need to show in pagination. Then in loop you can show only that category of posts. Lets assume your post's category ID is 5. Use'cat'=> 5
in your array.