get next next post in single.php
See answer here for some code that fetches several adjacent posts: Getting the Next and Previous Posts Titles in the Sidebar?
See answer here for some code that fetches several adjacent posts: Getting the Next and Previous Posts Titles in the Sidebar?
You can do this by using previous_post_link() and next_post_link(). These functions will create the links for you, and you should be able to get rid of all of the logic you are using for pagination. As you wish to only link to posts in the same category you should use the functions with the following … Read more
This could be acheived by using the get_previous_post() and get_the_post_thumbnail() functions. Then just pass the thumbnail value into the second parameter of previous_post_link(). $prevPost = get_previous_post(); $prevThumbnail = get_the_post_thumbnail( $prevPost->ID ); previous_post_link( ‘%link’, $prevThumbnail );
Post in Multiple Categories to stay in current category (permalink, next previous post link)
What you need to do is change the excluded_terms argument of the previous_post_link and next_post_link functions which you called $catagory. Simply remove all the category ids of your current post from that excluded_terms array. Make sure to define an array of categories which you don’t want to be displayed like you did it in your … Read more
Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
Show prev and next post links for parent post of current image in attachment page?
You have to modify the query that selects the posts to select by month. This bit of code placed in the template will get the page number and subtract that from the current month. <?php $page = get_query_var(‘paged’) ? get_query_var(‘paged’) : 1; $subtractor = $page-1; $date = date(“Y-m-d H:i:s”); $current_month = date(‘n’, strtotime($date.’-‘.$subtractor.’months’)); $current_year = … Read more
only just use echo and get_ <?php $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { $i = 0; while ($my_query->have_posts()) : $my_query->the_post(); if($i % 2 == 0) { ?> <div class=”row”><?php } ?> <div class=”col-md-6″> <div class=”overview”> <!– Post details here –> … Read more
It makes perfect sense, but kind of backwards. I think the query that is executed to “exclude” posts from categories is grabbing all of the categories (this may return category IDs 1, 2, 5, 7, 11, 13, 15, 16, and 23) initially then checking the “exclude_category” param (“11 and 13 and 15”) and running the … Read more