Forums Forums Search & Filter Pro S&F with Relevanssi Premium

Viewing 10 posts - 1 through 10 (of 18 total)
  • Anonymous
    #203495

    I’ve a website with Relevanssi enabled. In the header i’ve got a simple search fields. The results are displayed on the search.php page. What would like to know is how to do the following:

    1) Using the S&F plugin only add an appropriate filter ([searchandfilter]) to the search result page after a search is been made. The results are displayed via a WP_Qeury.
    2) Change the language of post type filter to English. Cannot find this in the settings.

    Trevor
    #203500

    1. You would need to change the header search field to send the search as a Search & Filter text search, or make a simple search form and replace the one in your header with that.

    2. Are you using a plugin like WPML or Polylang?

    Anonymous
    #203502
    This reply has been marked as private.
    Trevor
    #203504
    This reply has been marked as private.
    Anonymous
    #203507
    This reply has been marked as private.
    Trevor
    #203511

    Can you show me that code as it appears in that searchform.php template, and how is that called (what code) in the (header) template that calls it?

    Anonymous
    #203588

    It’s very simple:

    <form action="<?php echo site_url(); ?>" class="searchform" id="searchform" method="get" role="search">
    	<input type="text" id="s" name="s" value="" placeholder="Search... + Enter" />
    	<span class="icon"><i class="fas fa-search"></i></span>
    </form>
    Trevor
    #203676

    This will give you an idea of how to edit that form to use our plugin:

    <form action="<?php echo site_url(); ?>search-results/" class="searchform" id="searchform" method="get" role="search">
    	<input type="text" id="s" name="_sf_s" value="" placeholder="Search... + Enter" />
    	<span class="icon"><i class="fas fa-search"></i></span>
    </form>

    Note that I have changed the action to point to a slug named search-results. This would also need to be set in the form design (edit our form and on the Display Result settings tab). I have also edited the name from s to _sf_s.

    I think that should then work?

    Trevor
    #203678

    I am not sure if there needs to be a slash before search-results in that code.

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