Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Debbie Labedz

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Debbie Labedz in reply to:
    Search and Filter Pro not working with custom query
    #155191

    The modified query args you suggested worked. Thanks for your help!

    Debbie Labedz in reply to:
    Search and Filter Pro not working with custom query
    #155080

    Ok, I figured out a way to make it work, but I’m still running into one more issue.

    I reset the search form to use display results as a post type archive.

    I then created a separate page template that just displays upcoming productions, and am using the archives-productions.php template to display past productions, instead of the other way around.

    The filter UI is showing now and the filter works. However, I only want to display past productions, and then filter through those using the plugin.

    I tried using the edit query arguments filter, but I can’t seem to get it to work.

    Here’s what I added to my functions.php file:

    //Modify query args for filter UI on Productions archive template
    
    function filter_function_name( $query_args, $sfid ) {
      
      //if search form ID = 6128, the do something with this query
      if($sfid==6128)
      {
                //Today's date
                $today = date('Y-m-d H:i:s'); 
    
        $args = array(
                'meta_query' => array(
            array(
                'key' => 'event_date',
                'value' => $today,
                'compare' => '<=',
            ),
            )
    
                  ); 
      }
      
      return $query_args;
    }
    add_filter( 'sf_edit_query_args', 'filter_function_name', 20, 2 );
    Debbie Labedz in reply to:
    Search and Filter Pro not working with custom query
    #154903

    I tried to add the code to the existing query args, and it just returned. There was no UI for filtering the posts by year.

    Yes, I have two page templates that display the CPT Productions. The main CPT archive, file called archive-productions.php only displays future productions.

    I have another page template called page-past-productions.php that has a custom query that displays only past productions. This is the page where I want to display the filter UI.

    Debbie Labedz in reply to:
    Search and Filter Pro not working with custom query
    #154746

    I fixed that, but now just the custom query results appear as they did before, with no search or filter UI appearing.

    I also added the shortcode for the results, same thing.

    <?php do_shortcode('[searchandfilter id="6128"]') ?>
    
    						
    <?php do_shortcode('[searchandfilter id="6128" show="results"]') ?>
Viewing 4 posts - 1 through 4 (of 4 total)