Try this code here
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
if($paged == 1){
$posts_per_page = 100;
}else{
$posts_per_page = 300;
}
query_posts( array(
'posts_per_page' => $posts_per_page,
'post_type' => array( 'regularproducts', 'wpsc-product' ),
'paged' => $paged,
));
?>
Related Posts:
- Blog post per page setting conflicting with custom WP_Query?
- The next_posts_link() works only with original $wp_query
- Skipping first 3 posts in wp query
- How to exclude latest x posts from a paginated query?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Pagination not working on Custom Page Template
- Different amount of posts on homepage than paged pages
- Hiding posts in a list from specified categories
- Converting multiple loops into one single loop with pagination
- How would I get 1 latest post from a query for 5 posts?
- Exclude posts with empty post_content in wp_query
- Lazy Load using WP_Query pagination
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Reset Popular post query?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- How to : pagination in 3 different custom loops on the same page
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- posts_per_page option limits the number of Gallery items
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- Why are my paginated posts always returning the same results?
- why the same code got different results when using query_posts in functions.php and index.php
- Query for first 3 posts to change the look and feel
- How to get posts published on the latest date?
- Getting blog pagination to work on page set as front page
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- How to give classname to post if post has no content?
- WP_Query: Show 10 posts in date order, first three random
- Random posts that always include a particular post?
- WordPress post filter menu
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- Manipulated offset and pagination, can’t display last post anymore
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Show 5 posts and than 3 posts offset with pagination
- wp_query args with relation
- Override wp_link_pages pagebreak with filter
- Manipulate query to show specific post
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Pagination for custom query won’t let me back on page 1
- Adding a category at even positions on main loop with modified pagination
- Can’t get pagination to work
- How to inject a post within a loop
- The next_posts_link() works only with original $wp_query
- wp_query select if have comments
- Not displaying any articles on a custom made file
- Limit amount of pages shown in pagination within wp_query
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Accessing the post content with WP_Query
- How can I display 7 posts on the home page, but 9 posts on the subsequent pages?
- How can I get all posts data from within a paginated search result?
- Too many posts cause slow load when paginating
- Display posts with comments closed, with pagination?
- can’t use the page_test method to check pagination
- I want to query posts in monthly basis
- Limiting the number of posts in WP_Query leads to unexpected result
- How to add pagination in between post and comments?
- Why is querying posts messing up my pages?
- How to do set post permalinks using 6 digit random unique function?
- Multi row post list
- Display current post position in Elementor Posts widget
- Custom wp-query in wordpress rest api
- posts_per_page returning only one post
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- How to retrieve certain number of images from a wordpress post?
- WP_Query custom field pass the post id
- Current and next month posts
- WP_Query outputs wrong post in custom post type
- Order by meta_key field in WordPress not meta_value field value
- How to show post views shortcode data for each post on Posts List Page?
- How to remove a post from results by ID after query?
- WP_Query extended with AJAX
- Pagination for single post
- Custom Select Query pagination not working properly
- wordpress paginate, link to the right page
- What is wrong with this wp_query?
- send user to first page of results when reposting to page?
- Exclude sub sub categories from displaying in the archive page
- Change from all posts to specific categories post on main page?