Beaver Themer integration info on documentaion page #2

Forums Forums Search & Filter Pro Beaver Themer integration info on documentaion page #2

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #134668

    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');
    
    Trevor
    #134808

    Thanks for this!!

Viewing 2 posts – 1 through 2 (of 2 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.