I added the following to my functions.php file and it worked:
function toolset_fix_custom_posts_per_page( $query_string ){
if( is_admin() || ! is_array( $query_string ) )
return $query_string;
$post_types_to_fix = array(
array(
'post_type' => 'news_article',
'posts_per_page' => 6
),
// add another if you want
/*
array(
'post_type' => 'movie',
'posts_per_page' => 2
),
*/
);
foreach( $post_types_to_fix as $fix ) {
if( array_key_exists( 'post_type', $query_string )
&& $query_string['post_type'] == $fix['post_type']
) {
$query_string['posts_per_page'] = $fix['posts_per_page'];
return $query_string;
}
}
return $query_string;
}
add_filter( ‘request’, ‘toolset_fix_custom_posts_per_page’ );
Related Posts:
- PageNavi redirects to 404 when used as archive page
- Wp Pagenavi how to display all results
- Help making my pagination plugin better
- Help With A Reverse Pagination Plugin
- How to add pagination to wpbakery grid?
- Infinite Scroll for both Index, Category and Archive
- Dropdown menu on custom page with product to choose number of products per page
- Admin Panel pagination link styles
- Pagination Broken on Static Pages but Works on Blog Articles
- Plugin dropping pagination variable
- how to use in custom single.php template using php?
- How to show only next post pagination link using wp_link_pages()
- pagination on data fetched using SQL query
- How to apply next/previous classes to LIs for pagination links?
- Replacing global wp_query
- Change the number of plugins counted on wp-admin/plugins.php
- speed up pagination for huge database
- Article content navigator in wordpress like mbaskool website
- Pagination/404 I believe wp is getting a page ahead of itself
- Pagination not working
- Permalinks and pagination are not working in WordPress with WP e-Commerce plugin
- How to disable Wp-PageNavi at the top of the page
- how to show all posts of each category in pages
- How to Join wp_posts & wp_postmeta table using custom query
- Enable comments pagination only amp page
- Ajax Load More on Hierarchical Categories
- get recent 12 days post then random in wordpress
- homepage olderposts link showing page not found
- Pagination in category
- wp_pagination not displaying at top of page
- Next and Previous Pagination button not displaying in WordPress
- WooCommerce custom query and paging: Not Found error
- Infinite scroll for text in post with url page change
- How to create load more button without a plugin?
- Add pagination to a page with sections
- show Visual form builder in the front end
- Unfortunately removed myself as plugin committer
- Embed YouTube, login to buy & payment methods
- Duplicate use of WordPress plugin
- Category archive in menu
- Fake Single WordPress Post (Page) Loop
- WordPress filter function using query modifications
- date function not correctly returning date
- Have video content populate page from upload sub-directory?
- How to use a Must-Use plugin to hide a regular one and to hide itself?
- woocommerce download post-types\writepanels limits?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Integrating planning tools in wordpress
- cPanel login from WordPress
- TheCartPress plugin – Make every item in store unique
- Plugin not installing properly, functions being redeclared
- Unwanted Links and Spam WordPress Pages and Posts
- Display Plugin information on specific url
- Can I have a link within a WP UI Spoiler
- Extend WordPress Search
- WordPress internationalization + domains
- WordPress automatic plugin update
- How to structure plugin in to functions?
- How to find an option in the database?
- Use wordpress for school results?
- Need Help Creating a Multi-Step, Video-Guided Enrollment Site
- woocommerce_payment_complete hook only called after accepting payment?
- how to sort results by last day update at search result in plugin installer?
- How to set different users for different pages?
- Display alt text as tool tip on page
- User specific content (posts) / limiting visibility
- Carrying information from button click into form [closed]
- Getting error of unexpected output during activation
- Why is this plugin not working?
- Gravity Forms Salesforce field mapping for custom objects
- echo product-name in a link
- Strip shortcode from excerpt [duplicate]
- CSV file header
- How to use wp_http with https-pages?
- What is the Object for WP_Error Class?
- Upload an image in wordpress plugin
- Why won’t the Comprehensive Google Map Plugin load?
- PHP and Jquery pass value from form. Update function on DataBase
- WordPress plugin ajax post parameter
- Plugin – including external javascript calling google maps
- Plugin Hooks Not Shown in WP Cron Jobs
- Internationalization of Blog Posts
- Some of my php is rendered only when logged as admin
- How to change a specific page to custom page?
- Which part of the plugin to change so the updater won’t register the next version?
- Advanced Custom Field User Help URL
- Issues with Post 2 Post Plugin
- How can I make the Twitter Tools plugin hyperlink every link?
- Edit Buddypress Groups Activity Page Text [closed]
- Contents are missing but shown when switching to another theme in wordpress
- GravityForms to Salesforce API, problem with people who leave out company [closed]
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- product_tag to style an image
- Add plugin by SVN. Current version problem
- Non english charcters support for WP Customer Reviews
- Why links are not linked if edited comment?
- What possible reasons can cause my plugin not to be listed in the plugin search in the back-end of wordpress installs?
- In my plugin when i call select page is blank
- how to load a file from a plugin when a url is passed
- How to include css for plugin setting page? [duplicate]