Featured Image Link to next post?

Something like this should work for your single.php template: <?php $next_post = get_adjacent_post( false,”,false ); if( isset($next_post->ID) ): $next_id = $next_post->ID; else: $next_post = new WP_Query( ‘posts_per_page=1&post_type=photo&order=ASC’ ); $next_id = $next_post->post->ID; endif; ?> <a href=”https://wordpress.stackexchange.com/questions/27977/<?php echo get_permalink( $next_id ); ?>”> <?php echo get_the_post_thumbnail( $next_id, ‘thumbnail’ ); ?> </a>

next_posts_link and previous_posts_link problem

When using custom post types I got around this problem by using the following code. Of course you will need to put in the HTML for how you want it to display on your site. <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(”); // Enter you query here ?> <?php while ($wp_query->have_posts()) … Read more

query_posts pagination will always show identical content

Don’t use query_posts! As Eugene pointed out, you omitted the paged variable. However, even with that in you can get unexpected behaviour. As illustrated by the various questions we get on query_posts and pagination: query_posts and pagination, still stuck after much research Pagination throws 404 Pagination throws 404 error on custom taxonomy archive pages

How to exclude or filter password protected posts when using next_post_link() previous_post_link

The function next_post_link() allow excludes, with the parameter excluded_terms. Add a list of the IDs of the password protected posts to this param. You get a list of all password protected posts with the follow example via DB select. $password_pages = $wpdb->get_col(“SELECT ID FROM $wpdb->posts WHERE post_status=”publish” AND post_type=”post” AND post_password !=””); Alternative can you … Read more