Search Results for 'results.php'

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

Viewing 10 results – 481 through 490 (of 1,344 total)
  • Author
    Search Results
  • #190321

    Trevor
    Participant

    Are you are using our Shortcode Display Results method? If so, it detects if the WP-PageNavi plugin is present and uses that instead. Otherwise you would need to edit the results.php file to replace the navigation code in there. If you are using any other method to display the results, then it is the theme or posts plugin that controls this display.

    #190171

    Trevor
    Participant

    If you are using the Shortcode results method, and our results.php template file, it would look like this:

    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 {
      // your template archive code/loop OR results.php code here
    }

    Change 1024 to the ID number of your form (from the form shortcode).

    #190003

    Trevor
    Participant

    Hi Kendall

    Great to speak with you. You are going to try the shortcode method, customising the results.php file as detailed here:

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

    And replace this part:

    		<div>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			
    			<p><br /><?php the_excerpt(); ?></p>
    			<?php 
    				if ( has_post_thumbnail() ) {
    					echo '<p>';
    					the_post_thumbnail("small");
    					echo '</p>';
    				}
    			?>
    			<p><?php the_category(); ?></p>
    			<p><?php the_tags(); ?></p>
    			<p><small><?php the_date(); ?></small></p>
    			
    		</div>
    		
    		<hr />

    With your HTML/shortcode block. Let me know how you get on?

    #189741

    Trevor
    Participant

    You are now using our shortcode display results method, as described here:

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

    It uses a file called results.php for the template, but it can uses a file named after the form. Eg. form ID #1234 would use 1234.php

    As each translated form has its own ID, you can make individual templates for each language using the ID numbers and edit the file according to the Customising guide you see on the page linked to above.

    #189646

    In reply to: Various Issues


    Trevor
    Participant

    The no more results message can only be changed/added if you are using our Shortcode Display Results method. If you are, then this is an example of the modified results.php:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 Designs & Code
     * 
     * Note: these templates are not full page templates, rather 
     * just an encaspulation of the your results loop which should
     * be inserted in to other pages by using a shortcode - think 
     * of it as a template part
     * 
     * This template is an absolute base example showing you what
     * you can do, for more customisation see the WordPress docs 
     * and using template tags - 
     * 
     * http://codex.wordpress.org/Template_Tags
     *
     */
    
    if ( $query->have_posts() ) {
     ?>
     
     Found <?php echo $query->found_posts; ?> Results<br />
     <div class='search-filter-results-list'>
     <?php
      while ($query->have_posts())
      {
       $query->the_post();
       
       ?>
       <div class='search-filter-result-item'>
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        
        <p><br /><?php the_excerpt(); ?></p>
        <?php 
         if ( has_post_thumbnail() ) {
          echo '<p>';
          the_post_thumbnail("small");
          echo '</p>';
         }
        ?>
        <p><?php the_category(); ?></p>
        <p><?php the_tags(); ?></p>
        <p><small><?php the_date(); ?></small></p>
        
        <hr />
       </div>
       
       <?php
      }
     ?>
     </div>
    <?php
    } else {
     
     //figure out which type of "no results" message to show
     $message = "noresults"; 
     if(isset($query->query['paged'])) {  
      if($query->query['paged']>1){
       $message = "endofresults";
      }
     }
     
        if($message=="noresults") {
        ?>
     <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
      <span>No Results Found</span>
     </div>
     <?php
        } else {
     ?>
     <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
      <span>End of Results</span>
     </div>
     <?php
     }
    }
    ?>

    The loading icon position, try this custom CSS (it MIGHT work):

    .search-filter-scroll-loading:before {
        display: block;
        height: 10px;
        content: "";
        width: 100%;
    }
    .search-filter-scroll-loading {
        margin: 10px auto !important;
    }
    #189428

    Trevor
    Participant

    The shortcode display results method uses our exemplar template – results.php. The basic steps for customising the file are set here, but you would need to do the coding:

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

    The ACF documentation gives you how to get the data from their fields. This post shows an example results.php template file that gets ACF fields:

    https://support.searchandfilter.com/forums/topic/output-acf-post-object-fields-in-results/#post-102009

    #189395

    Anonymous
    Inactive

    Hi Rob,

    Sure no problem. I can send you my custom results.php file.
    The HTML used is based on the grid used in the Theme I use, so you would have to create some CSS to make it look like that. Or just copy it from my frontend with Crome Inspector.
    Also I’m using some ACF fields, change these to your own fields.

    Send me a private reply with your email address and I’ll get back to you?

    #189283

    In reply to: Ajax Filter


    Trevor
    Participant

    Great to speak with you Dave. For now we have set you up using the Shortcode method which seems to work fine (and can work with two forms, which will have identical fields, using only one results shortcode). You have already dropped your own article HTML/markup into the custom results.php template and that seems to work fine.

    I look forward top hearing how you get on.


    Trevor
    Participant

    The results.php file needs a different structure to be use for infinite scroll. Tow exemplar results templates are given with the plugin (look the in the plugin templates folder), but the file must be named either results.php OR 1234.php (or whatever the form ID is).

    I am assuming your customised version is in a sub flder of the child theme already?

    #188996

    Trevor
    Participant

    Hi John. I will be on this in a while. Are you using our Shortcode Display results method, and did you customise the results.php file if you are?

Viewing 10 results – 481 through 490 (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.