Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 71 through 80 (of 1,224 total)
  • Author
    Search Results
  • #263728

    Anonymous
    Inactive

    Thanks, Trevor, for your reply.
    Unfortunately it doesn’t work… something with the archive module of brizy and S&F Pro archive setting seems to be incompatible. I will ask brizy support about that.
    I think I checked all kinds of settings displaying the search results in the meantime.
    What is working with brizy template is using shortcode – but here the problem is that it’s not showing the content of each post on the results page (in this case the audio-players, which is essential), but the excerpts. And my knowledge to change it to the content (changing ‘the_excerpt’ to ‘the_content’ at line 60 in results.php) is not enough; after this change I got a loop in the loop and a screwed up page.
    Any idea how I can do this? It good be proper workaround.

    Thank you.

    #263495

    Trevor
    Participant

    In that you may want to display data from custom fields and taxonomies, the shortcode method is probably best. We are working on alternatives, but for now I think this is the way for you.

    When using the Shortcode display results method, it uses a template file named results.php. You would need to customize that, as per this starter guide:

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

    Is that what you needed to know?

    #263014

    Anonymous
    Inactive

    Hi Trevor,

    Ok many thanks for your help. To resolve my issue, I will use the short code method and use the customization of results by modifying the results.php file (instead of enfold products grid).
    Can you please tell me how to display the other products’s attributes like description and custom attributes ?

    Regards,

    #262848

    Trevor
    Participant

    You could use this alternative results.php template:

    <?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 ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    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
     }
    }
    ?>

    Trevor
    Participant

    I fixed that link. Can you check/confirm that you did follow the advice there?

    As to the bullet points. This theme CSS file:

    https://www.hifi-advice.com/blog/wp-content/themes/theblog/style.css

    On line 861 has this CSS, which is causing them:

    .body-content ul > li:before {
        content: "\f105";
        font-family: "FontAwesome";
        position: absolute;
        left: 0;
        top: 5px;
        line-height: 1;
    }

    Add this custom CSS to the theme customizer to fix this:

    .body-content .searchandfilter ul > li:before {
        content: none;
    }

    Once I have the answer to the first part of this reply, I need to see the content of the results.php file, IF you have modified it? If you did not modify it, do you have a Related Posts plugin installed (which one), as it may be automatically adding that content after the post excerpt?

    #262240

    Trevor
    Participant

    Are you able to send me a live link/URL to your search page so I can take a look?

    Which Display Results Method are you using? With some, it cannot be done, with those using a PHP template, it can, with some coding. For example, 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(1234)->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
    }

    Where the ID number in this needs to match your form ID (replace 1234). Similar code can be used in your own PHP template file.

    #262213

    In reply to: Pagination not working


    Anonymous
    Inactive

    Hi Trevor, Thanks for repling

    That Divi module integration didn’t exist when I set this up I don’t think.

    I’ve created a new page to play with this https://www.miskinmedia.co.uk/views-digital-journalism/views-blog2/

    The layout would all need styling again which is ok but the pagination still isn’t working. Clicking Older Posts just makes the page ‘fade’ with some kind of overlay.

    Am I missing something simple? Would I still need to edit results.php? I didn’t edit that originally.

    #262076

    In reply to: Search Form on Top


    Trevor
    Participant

    For 1, you would have had to specify a template file to use.

    You would need to be using a child theme. You copy that file to the child theme folder, and then edit it to add the PHP do_shortcode code as shown here:

    <?php echo do_shortcode('[searchandfilter id="710"]'); ?>

    You may also need to make the form horizontal, like this (change the px value to match your theme’s mobile/responsive breakpoint):

    @media (min-width: 992px) {
      .searchandfilter[data-sf-form-id="710"] {
        display: inline-block;
        vertical-align: top;
        padding: 0 20px;
      }
    }

    These are for guidance only. We do not include customising your theme and templates within the scope of support.

    2. You wish to use the Shortcode method, but will need to create you own template. You still need to use our results.php template file, but customize it according to these instructions:

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

    This is only a simple exemplar template, which uses the WordPress Codex structure and PHP.

    So, what to do? You can replace almost anything you want in the file, but keep the if … else … endif and the while …. endwhile and transplant your own HTML, PHP and class names to replace our code. Do this slowly and test regularly, keeping backups at each stage.

    The results.php template code will run inside your theme’s standard page template, in the content part, called by our results shortcode.

    Again, we do not offer a coding service to do this, but it is fairly standard WordPress code, so you can often copy code from elsewhere in your theme.

    #262046

    In reply to: Pagination not working


    Trevor
    Participant

    As you are using the Shortcode method (see below about the Divi integration), it would depend on what changes you have made to the results.php template file, especially the pagination.

    I am not sure if it is relevant, but you are not using our Divi Extension? I wonder if this would help (but you would need to use the Divi Blog module, which may not be suitable for you). You can find it for download (if you are logged in) at the top of this guide page:

    https://searchandfilter.com/documentation/3rd-party/divi/

    #262019

    In reply to: Changing results page


    Trevor
    Participant

    I think I understand. You wish to use the Shortcode method, but create you own template. You still need to use our results.php template file, but customize it according to these instructions:

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

    This is only a simple exemplar template, which uses the WordPress Codex structure and PHP.

    So, what to do? You can replace almost anything you want in the file, but keep the if ... else ... endif and the while .... endwhile and transplant your own HTML, PHP and class names to replace our code. Do this slowly and test regularly, keeping backups at each stage.

    The results.php template code will run inside your theme’s standard page template, in the content part, called by our results shortcode.

Viewing 10 results - 71 through 80 (of 1,224 total)