Access active query

Forums › Forums › Search & Filter Pro › Access active query

Viewing 10 posts – 1 through 10 (of 13 total)
  • Anonymous
    #59243

    Hello,

    I would like to display some text on my first page of archive based on if user did not filter anything. Can you help me with this?

    Regards

    Trevor
    #59255

    So, if I understand you, you want to run a check to see if the query is filtered, and if it is NOT then display som content? Do you still want to show the posts or do you want the page to only show posts when the user has made a filter selection?

    Anonymous
    #59296

    Exactly, I wanto to check if query is filtered and then display something that doesn’t inovolve posts. It’s a custom code. I tried $searchandfilter->get(filter_id)->current_query() with is_filtered() but it always returns 1.

    Trevor
    #59315

    Are you using the shortcode display method?

    Anonymous
    #59318

    Yes.

    Trevor
    #59325

    You used the is_filtered function in the results.php? And did you make a custom copy of the results.php template file (per our documentation)?

    Anonymous
    #59342

    Oh, sorry. I’m displaying filter with shortcode. For results I have custom template in custom post type.

    Trevor
    #59348

    Ah, but in the form, what is the Display Results method set to? if it is shortcode, then the plugin uses our results.php template.

    Anonymous
    #59350

    It is post type archive.

    Trevor
    #59443

    Is it possible to use the Shortcode method? That way you can play with the results.php template that we provide. Alternatively, you would need to edit the template file for that post type’s archive page in your theme to add the is_filtered condition.

Viewing 10 posts – 1 through 10 (of 13 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.