Pagination resolving to first page only

Building off of what Rarst has said, I’m pretty sure the query string will retain ‘paged’ queries even if WP_Query strips it out as irrelevant. You could try replacing your query posts line with this: global $query_string; parse_str( $query_string, $my_query_array ); $paged = ( isset( $my_query_array[‘paged’] ) && !empty( $my_query_array[‘paged’] ) ) ? $my_query_array[‘paged’] : … Read more

How to add CSS Class to previous_post_link or get previous/next post link URL

You can use the more native function that is “below” the previous_/next_post_link();: # get_adjacent_post( $in_same_cat = false, $excluded_categories=””, $previous = true ) $next_post_obj = get_adjacent_post( ‘”https://wordpress.stackexchange.com/questions/17218/,”‘, false ); $next_post_ID = isset( $next_post_obj->ID ) ? $next_post_obj->ID : ”; $next_post_link = get_permalink( $next_post_ID ); $next_post_title=”&raquo;”; // equals “»” ?> <a href=”https://wordpress.stackexchange.com/questions/17218/<?php echo $next_post_link; ?>” rel=”next” class=”pagination pagination-link … Read more

Why do you need an unlikely integer in paginating?

Note the get_pagenum_link( $big ): This will create an URL (not a link) based on the number provided in the first parameter. That function is used to get the basic pattern for the URL, and the high integer is used here, because: You must provide an integer as argument. The resulting URL is filtered with … Read more

Paged posts – how to use numbers and next/previous links?

The function you’re using, wp_link_pages­Codex, does not have the feature you’re looking for by default. However you can easily extend it by using a callback function, registered as a filter on that functions arguments: add_filter(‘wp_link_pages_args’, ‘wp_link_pages_args_prevnext_add’); The filter will then modify the parameters that are used in that function on-the-fly and inject the missing links … Read more

How to determine if theres a next page

You can use get_previous_posts_link and get_next_posts_link to determine if they exists like this: $prev_link = get_previous_posts_link(__(‘&laquo; Older Entries’)); $next_link = get_next_posts_link(__(‘Newer Entries &raquo;’)); // as suggested in comments if ($prev_link || $next_link) { echo ‘<ul class=”navigation”>’; if ($prev_link){ echo ‘<li>’.$prev_link .'</li>’; } if ($next_link){ echo ‘<li>’.$next_link .'</li>’; } echo ‘</ul>’; } Hope This Helps

Changing pagination list class

paginate_links() doesn’t offer a parameter and there are no hooks – see source – available to change the class(es). Which means you can do it like you have done it or you create your own pagination function based on paginate_links().