Pagination is not working wp_query custom fields values

you need to add global $paged and then in your array that is being passed to WP_Query you need to add ‘paged’ => $paged global $paged; $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query( array( ‘meta_key’ => ‘wpcf-gender’, ‘meta_value’ => ‘1’, ‘meta_compare’ => ‘==’, ‘post_type’ => ‘profile’,’posts_per_page’ => 2, ‘paged’ => $paged ) … Read more

pagination doesn’t show up for custom post type

Rather than attempt to fix your query, I recommend you sidestep it entirely by using custom post type archives! With permalinks on, you should be able to view a list of all your movies posts by going to: example.com/movies Then, in your theme, create archive-movies.php, and it will be used instead of the archive.php/index.php for … Read more

Setting pagination for images attached to a post

You could use paginate_links() to paginate the total gallery. This highly depends on your permalink settings. The best would be to check other answers on that topic here on WPSE. Next/Prev post links for attachments. Than there’s also the task to navigate on single attachment display. Default API function/template tag There’s the adjacent_post_link() function that … Read more

Combining WordPress pagination functions for archives and search results

From the Codex: To add pagination to your search results and archives, you can use the following example: <?php global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) ) ), ‘format’ => ‘?paged=%#%’, ‘current’ => max( 1, get_query_var(‘paged’) ), ‘total’ => $wp_query->max_num_pages … Read more

WordPress pagination on custom script

It is unclear exactly which “built-in pagination methods” you are looking for. WordPress uses several. If you are looking for the next_posts_links and previous_posts_link functionality, write your own function as those built-in functions depend upon the $wp_query global as you can see in the source. I doubt it is worth the time and effort to … Read more