Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 511 through 520 (of 1,224 total)
  • Author
    Search Results

  • Anonymous
    Inactive

    Hi,

    I have only been using Search and Filter pro to display the results of one post type, until now. I now need a second search and results page for a second post type. I have been displaying results via shortcode and have a custom results.php file but, it is set up specifically for the results of Post Type A.

    Now I have post type B, I need the ability to have a customized results template for the results of that post type too.

    How can I achieve this? If possible, I prefer displaying via shortcode and using the results.php file in my theme files structure. I am not familiar enough with displaying via Archive or Post Type Archive.

    Thanks

    #179747

    Trevor
    Participant

    I have a copy of Elementor Pro myself and I cannot get our plugin to work with the grids in it. Instead, I have to use the Shortcode Display Results method and I hand code the results.php files, and it is not a simple matter. Until we release v3 of Search and Filter (not soon), that is the only way. With v3 comes the possibility of addons to provide integration with other themes and page builder plugins, assuming that the theme and page builder landscape (which are popular and which are not) does not change.


    Trevor
    Participant

    The last time I used Avada, I ended up having to hand code the results.php files, and it is not a simple matter. Until we release v3 of Search and Filter (not soon), that is the only way. With v3 comes the possibility of addons to provide integration with other themes, assuming that the theme landscape (which are popular and which are not) does not change.


    Anonymous
    Inactive

    And that’s kind of what I’ve done:

    I’ve set up the two pages. I’ve set up two different S&F forms with their corresponding categories and tags, and inserted the appropriate shortcodes on the two pages.

    It’s the styling part where I’m stuck. I didn’t know if there was an EASY way to pull one of the Avada blog layouts/styles into that results.php file (I know a teeny-tiny bit of PHP to make some small modifications…and that’s about it)?

    #179725

    Anonymous
    Inactive

    OK – used a static title. Re the number of results I’ve copied the code from results.php but it doesn’t return the number:

    <?php if ( have_posts() ) : ?>
    <header class=”page-header”>
    <h1 class=”page-title”>My Title</h1>’
    </header><!– .page-header –>

    Found <?php echo $query->found_posts; ?> Results<br />
    Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?>

    And for the search term I meant “is possible to show the numbers next to the filters (on the search form)?” rather than on the results page.

    #179713

    Trevor
    Participant

    You don’t need a function in there at all.

    You can simply put this:

    <header class="page-header">
      <h1 class="page-title">Search Results</h1>
    </header><!-- .page-header -->

    As for placing the search terms, that is a little harder. It would have to be done by your theme, or in that template. You can look at how we do it (for the Shortcode method) in the file results.php found in the plugin’s template folder, and also see this documentation:

    https://searchandfilter.com/documentation/accessing-search-data/

    Note that when the results update using Ajax, the search terms can only update if the method that you use to show these is inside the code that makes the id=”main” section of the page.

    #179700

    Trevor
    Participant

    OK. The Title we can fix I think. After that is done, then I will explain the page thing. Using ftp, can you copy from your child theme folder the file archive.php to make a new file called search-results.php in that same folder?

    #179658

    Trevor
    Participant

    You would need to be using our Shortcode Display results method, and have followed the guide to customising:

    https://support.searchandfilter.com/documentation/search-filter-pro/search-results/using-a-shortcode/

    Once you have a copy of the results.php file in a search-filter sub-folder of your theme, you can edit that file, like this (leave the PHP comments at the top outside and before this code):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the results.php PHP code here
    }

    Make sure you change the ID number in that snippet to the ID number of your form.


    Trevor
    Participant

    Hi

    So, we sorted this by using code in the results.php file to stop the results showing at all. The developer at your end has written javascript to re-submit the form with a date filer, and at tha point the results then show. Not an ideal solution to do it that way, but it works. I will close this thread for now.

    #179434

    Trevor
    Participant

    Which Display Results method are you using? If it is the Shortcode method, you should follow this customising guide:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    You will have a copy of the results.php ile in your theme folder (in a sub-folder called search-filter). In that, you can edit the message.

    The spinner isn’t a standard feature but can be done using javascript, which we can look at once I get the No Results Found part sorted.

Viewing 10 results - 511 through 520 (of 1,224 total)