Disable pagination only for specific category

You can try this, replacing my_cat with your category slug. This will modify the main query just before rendering the loop on the archive page of your category. add_action( ‘pre_get_posts’, ‘wpse_disable_pagination’ ); function wpse_disable_pagination( $query ) { if( is_category( ‘my_cat’ ) { query->set( ‘posts_per_page’, ‘-1’ ); } }

Search – Ajax – Alter Query Parameters with Pagination

I think this is what you want. base is set via home_url(), format is page/%#%/, search query arg is added via add_args if it exists: $args = array( ‘base’ => home_url( ‘/%_%’ ), ‘format’ => ‘page/%#%/’, ‘current’ => max( 1, get_query_var(‘paged’) ), ‘total’ => $temp->max_num_pages, ); if( isset($_GET[‘s’]) ){ $args[‘add_args’] = array( ‘s’ => $_GET[‘s’] … Read more

How to “Load More” posts via AJAX?

You can use ajax to load more posts on your archive page. attach a js/jquery click event on the More link send ajax request to admin-ajax.php (use wp_localize_script to get the ajax url to front end) with page number (track this with js variable). handle ajax request in php. Add custom ajax actions with add_action( … Read more

Pagination adding extra posts only on page 2

Here’s a suggestion for a general way to support different number of posts on the home page than on the other paginated pages. We should use the main query instead of sub-queries, if possible. Formula It seems to make sense to take the offset for paginated pages as: offset_op = ( paged – 1 ) … Read more

Paginate Custom Post Type Page

The following works for me (I’ve removed all the formating / custom post meta). I would add, its not clear why you need to use a page with a custom template, and don’t instead create a template called archive-portfolio.php which is used for a custom post type’s archive pages (see template hierarchy) <?php /* Template … Read more

Pagination gives 404 error

Have you tried this? I had gotten the same problem before. I did these steps, and it works for me. I use this code in my functions.php // New method of WordPress Query since 3.4.1 if ( ! function_exists( ‘ucc_add_cpts_to_pre_get_posts’ ) ) { function ucc_add_cpts_to_pre_get_posts( $query ) { if ( $query->is_main_query() && ! is_post_type_archive() && … Read more