Custom post type archive with pagination?

As you can see in the rewrite analyzer, /projects/page/2/ sets projects=page&page=/2 instead of pagename=projects&paged=2 as we would like. So you just need to add a rewrite rule for this special case (in the register_projects() function, after you register your custom post type, would be a good place): add_rewrite_rule( ‘projects/page/([0-9]+)/?$’, ‘index.php?pagename=projects&paged=$matches[1]’, ‘top’ ); Remember to flush … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)