Plugin: Events manager – Next and previous event

The function WordPress ultimately uses for this is get_adjacent_post(), which has filters that allow you to modify the query directly. You’d have to modify the JOIN, WHERE and ORDER BY clauses to join the post meta table and order by your custom field. Another option is the Ambrosite Next/Previous Post Link Plus plugin.

Show multiple next and previous posts

This one is not a good way to do it but it’s easy to implement global $post; $original = $post; $next = get_next_post(true); $prev = get_previous_post(true); $post = $next; next_post_link(); $post = $original; next_post_link(); // display current post previous_post_link(); $post = $prev; previous_post_link(); $post = $original; To make the code more efficient, you can copy … Read more

Next Page & Previous Page links – skipping a single page – how?

I just tried this and it works for me. Given that you would like to exclude page id 4 this is the code you are looking for. <?php $pagelist = get_pages(‘sort_column=menu_order&sort_order=asc&exclude=4’); $pages = array(); foreach ($pagelist as $page) { $pages[] += $page->ID; } $current = array_search($post->ID, $pages); $prevID = $pages[$current-1]; $nextID = $pages[$current+1]; ?> <div … Read more

How can I change the prev / next buttons text to Dutch?

If you’re simply using one language on your site: Find the utility.php file in your themes folder with location lib/functions/utility.php Next find the lines 227 and 231 and change the __( ‘Previous Post’, ‘contango’ ) and __( ‘Next Post’, ‘contango’ ) to your desired values. For example: previous_post_link( ‘%link’, __( ‘vorige post’, ‘contango’ ) . … Read more

Previous and older set of posts links

The other question is completely wrong and should not be used previous_post() and next_post() is both depreciated functions and should not be used anymore Never replace WP_Query with query_posts to solve a problem. This actually creates more. Also, query_posts should never be used showposts is also depreciated in favor of posts_per_page To make pagination work, … Read more

Get previous posts list

Did you chceck the Codex Date Parameters ? Expecially the ‘before’ param.It works like this: $date = get_the_date(‘Y-m-d H:i:s’); $args = array( ‘date_query’ => array( array( ‘before’ => $date ), ), ‘posts_per_page’ => 10, ); $query = new WP_Query( $args );

Get previous/next post from (specific) category

When in_same_term parameter in get_next_post() / get_previous_post() function is set to TRUE, a post is selected from any category assigned to the current post. As you wrote, you can not use the exclude parameter in this case. Using the get_{$adjacent}_post_where filter, you can skip product in the category list, which you are looking for posts. … Read more