- This topic has 1 reply, 2 voices, and was last updated 8 years, 2 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Beaver Themer integration info on documentaion page #2
Tagged: Beaver Themer integration
This is additional info to integrate S&F to BeaverBuilder/BeaverThemer
Pagination problem in ajax mode needs this to reset the page number.
if(isset($_GET['sf_paged'])){ global $wp_the_query; $wp_the_query->set('paged',$_GET['sf_paged']); }
Also when you want to filter Posts module on a Page but Themer’s archive layout, pre_get_posts action works.
To target specific page/module, I used is_page(), query_vars[‘fl_builder_loop’] and query_vars[‘post_type’].
Then use $query->set(“search_filter_id”,***);
So the function will be like this.
function my_pre_get_posts_function($query){
if(is_page(999) && $query->query_vars['fl_builder_loop'] == 1 && $query->query_vars['post_type'] == 'some_cpt'){
$query->set("search_filter_id",111);
}
if(isset($_GET['sf_paged'])){ global $wp_the_query; $wp_the_query->set('paged',$_GET['sf_paged']); }
}
add_action('pre_get_posts','my_pre_get_posts_function');