Forums Forums Search & Filter Pro Default result

  • This topic has 18 replies, 2 voices, and was last updated 8 years ago by Anonymous.
Viewing 10 posts - 1 through 10 (of 19 total)
  • Anonymous
    #68644

    Hi! I create a ACF checkbox called “archived”.

    I need my default search result not showing any post that is checked “archived”.

    Into my search, the checkbox “archived” is not check.

    Anonymous
    #68645
    This reply has been marked as private.
    Trevor
    #68661

    The search works, yes? But, by default, you only want archived posts?

    Anonymous
    #68665

    Yes the search works fine 🙂
    But by default I don’t want to see meta post “archived” checked post.

    Thanks

    Trevor
    #68667

    But you might want to allow it by the user? Does it need to be checked or not checked to do as you wish?

    Anonymous
    #68669

    Yes I want to allow the user to see “archived” when they check it
    But by default not showing that kind of post

    Thanks

    Trevor
    #68671

    It IS possible, but I have never done it. You would need to use the is_filtered() function to see if the filter has yet been used (or has been reset) and then use sf_edit_query_args filter to change the incoming filters applied to the page. All this in your child theme functions.php file.

    You might find ideas in this github repository from the developer of Search & Filter:

    https://github.com/rmorse

    Anonymous
    #68677

    Good!
    Thanks for your answer, I’ll try it!

    Trevor
    #68684

    Or, if you were willing to do so, you could append to the menu link for the page the query string that makes it so.

    Anonymous
    #68698
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 19 total)