Forums Forums Search & Filter Pro Search & Filter with Post Grid Plugin

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #91016

    Hi,

    I’ve been trying to follow along with this discussion:
    https://support.searchandfilter.com/forums/topic/create-a-search-form-like-the-demo-movie-reviews/

    …which led me to the Post Grid plugin that I’d like to use to display my results.

    I tried adding this to my functions.php

    function post_grid_filter_query_args_extra($query_args) {
      $extra_query = array (
        'search_filter_id' => 137,
      );
      return array_merge($query_args, $extra_query);
    }
    add_filter('post_grid_filter_query_args','post_grid_filter_query_args_extra');

    …and then use the post grid code in my template:
    <?php echo do_shortcode("[post_grid id='372']"); ?>

    But the filter doesn’t seem to link up correctly. I feel like I’m missing something or the code above is specific to that previous customers theme.

    Any direction would be greatly appreciated.
    Thanks

    Trevor
    #91042

    What display method are you using in search & Filter? I think it should be ‘As an Archive’.

    Anonymous
    #91099

    Yes as an archive and have set the filename to my custom template.

    Anonymous
    #91101

    HI Trevor, I was reading thoguh the documantation adn I didn’t have this code added to functions.php

    add_filter('wp_title','search_form_title');
    
    function search_form_title($title){
     
     global $searchandfilter;
     
     if ( $searchandfilter->active_sfid() == 35889)
     {
     return 'Search Results';
     }
     else
     {
     return $title;
     }

    If I add it the website stops loading.

    Trevor
    #91103

    There is a final curly brace missing in that.

    Anonymous
    #91105

    Well spotted. This doesn’t fix the page not loading sorry.

    Trevor
    #91107
    This reply has been marked as private.
    Trevor
    #91118

    I had a quick look at the other thread and noticed that Ross said:

    set S&F display mode to “post type archive” and then use the post grid plugin to format your post type archive too

    So as an archive will not likely work.

Viewing 8 posts - 1 through 8 (of 8 total)