Search Results for 'results.php'

Forums › Forums › Search › Search Results for 'results.php'

Viewing 10 results – 61 through 70 (of 1,344 total)
  • Author
    Search Results
  • #265810

    In reply to: Pagination


    Anonymous
    Inactive

    Thanks for the help, I tried, the results.php page is composed as follows:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(11690)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()==””)) {
    echo ‘<div>Nothing to see here folks!</div>’;
    } else {
    // the current resuts.php code here
    }

    ?>

    <?php
    while ($query->have_posts())
    {
    $query->the_post();

    ?>
    <div class=”farmacia”>
    <h2 class=”nome-farmacia”>“><?php the_title(); ?></h2>
    <?php the_content(); ?>

    </div>

    <hr />
    <?php
    }
    ?>

    If I go to https://www.staging2.biotechmed.it/farmacie/ it shows me all the results… My client does not want that someone can easily see all the results and download all the names.

    Another question, is it possible to search only in two specific fields and ignore the others in the search?

    #265799

    In reply to: Search Result Display


    Trevor
    Participant

    As you are using our shortcode method the display of the results comes from our results.php file. You would need to customise it as described (in basic form) here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    To change the image size, edit these lines:

    <?php
    if ( has_post_thumbnail() ) {
      echo '<p>';
      the_post_thumbnail("small");
      echo '</p>';
    }
    ?>

    I would suggest changing small to thumb.

    You can change/delete other lines or parts. For example, to remove the date, you would need to remove this line:

    <p><small><?php the_date(); ?></small></p>

    #265739

    In reply to: Pagination


    Trevor
    Participant

    I see that you are using our Shortcode method …

    … in which case you should follow 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(11690)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the current resuts.php code here
    }

    This code will prevent any results from showing UNTIL a search has been made. If you need to modify it a little, at least it should give you some ideas.

    You can show ALL results (no pagination) if you set in the form on the General settings tab the ‘Results per page’ to -1.

    The you need to remove the pagination output from the results.php code, so delete the two blocks that look like this (one before the loop, one after):

    Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    <div class="pagination">
    		
    	<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    	<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    	<?php
    		/* example code for using the wp_pagenavi plugin */
    		if (function_exists('wp_pagenavi'))
    		{
    			echo "<br />";
    			wp_pagenavi( array( 'query' => $query ) );
    		}
    	?>
    </div>
    #265638

    Trevor
    Participant

    So, using our Shortcode method …

    … in which case you should follow 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(8702)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the current resuts.php code here
    }
    #264582

    Anonymous
    Inactive

    Yes i made my own template for the results.php that i put in my-theme/search-filter as explained in this page https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    I just disabled Ajax, as you can see, the page reloads at each search but the custom template is not loaded at all.

    #264574

    Trevor
    Participant

    It appears the you have modified the results.php to match your theme, and that is OK to do. But, I think Ajax is not refreshing the page correctly because of this. Can you test with Ajax disabled?

    #264565

    In reply to: Infinite Scroll


    Trevor
    Participant

    Ah, I think I see the problem now.

    In the Search & Filter -plugin folder, in the subfolder named templates, are two files. Normal pagination template is results.php, and there is another for infinite scroll, with a similar but different structure.

    Which one did you use?

    Whichever one you used, you need to follow our guide when doing that:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    The file must be renamed to either results.php or {the number of the form ID}.php

    #264494

    Anonymous
    Inactive

    Hi,

    I use your great plugin with the shortcode method.
    I need to customize my results so i add my results.php file in my child theme and it works, except for the default results which appear before the firest search when i load my page.
    Once i click on the search button, the results are shown as i want them to.

    Is there some option i missed somewhere to make it works?

    Thank you very much and have a nice day.
    Leslie

    #264461

    In reply to: Infinite Scroll


    Trevor
    Participant

    Can you share with me the content of the results.php template file you are using (you can remove the many comment lines)? Please post any code inside code ticks (one before the code, one after)? On my UK Windows keyboard, the code tick key is next to the 1 key in the standard part of the keyboard. If you do this Google search and look at the images, they show various keyboards and where the key is located:

    https://www.google.com/search?q=back+tick+code+key

    #263788

    Anonymous
    Inactive

    I prepared the website so that it’s showing search results using shortcode – please do simply a new search.
    To do this I had to embed a shortcode-element in brizy-template.
    Changing line 60 of results.php to ‘the_content’ has the effect that it seems to run brizy loop as the first result and then repeating empty results – and the players are not shown at all.

    I will keep you up to date with what brizy support will say.
    Thanks again for your time and your investigation!

Viewing 10 results – 61 through 70 (of 1,344 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.