Forums › Forums › Search & Filter Pro › change the posts_per_page argument in WP Query
- This topic has 8 replies, 2 voices, and was last updated 8 years, 3 months ago by
Anonymous.
-
Anonymous(Private) July 15, 2017 at 11:48 am #120734
Thanks for the quick reply.
But that would mean two different search forms. (one with posts_per_page = 9 and one with -1).
But the search is done on the homepage and the results displayed on the ‘te-huur’ page. I just need those same results for two different ‘tabs’ so the same results with ‘9’ and ‘-1’, but for that i need to alter the search form argument that sets it to ‘9’. If that is possible.Anonymous(Private) July 15, 2017 at 11:51 am #120736$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'order'=> 'ASC', 'orderby' => 'date', 'post_type' => 'panden', 'posts_per_page' => 9, 'meta_key' => 'status', 'meta_value' => array('Te huur', 'Te huur onder reservatie'), 'paged' => $paged); $args['search_filter_id'] = 71; $pandenLoop = new WP_Query($args);I thought I would create a new WP_Query with those same arguments and just alter the ”posts_per_page’ => 9,’. But these are set in ‘$args[‘search_filter_id’] = 71;’ and I don’t know how to access those arguments.
posts_per_page' => 9has no effect here because it take that argument from$args['search_filter_id'] = 71; -
AuthorPosts