In Woocommerce, I need to limit post with a wp_query
.
I know how to limit post in wp_query
For example if this page id is 20, I am running the query:
function wpcodex_filter_main_search_post_limits( $limit, $query ) {
if ( get_the_ID()==20 ) {
return 'LIMIT 0, 12';
}
return $limit;
}
add_filter( 'post_limits', 'wpcodex_filter_main_search_post_limits', 10, 2 );
But I need to set the limt as 25 to 35.
How to do this?
Even if I am placing return 'LIMIT 25, 35';
it is still showing first 35 products, not the posts between 25 to 35.
That query is like: LIMIT 10 OFFSET 15
Please help me.