Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 231 through 240 (of 1,224 total)
  • Author
    Search Results
  • #227927

    Trevor
    Participant

    Thank you for contacting us.

    To stop the form from going to the results until the submit button is clicked, please disable the Auto Submit option, shown here:

    https://www.screencast.com/t/x1hr77AlzK

    You are using the post Type Archive display results method, so it will not be using the results.php file; this method uses your theme template file for that post type.

    The form is displayed on a page using a widget or shortcode. You would not place the form inside our results.php template file. So, for example, add a sidebar to a page and add a widget. Or, if you use a Page Builder, add a text element and place the shortcode inside that.

    I do not understand these questions:

    On the results page, I don’t need to navigate the page numbers. That is, 1,2,3,4,5 … should be clickable
    And the shape of the filter is displayed at the top, and I need to place it on the left. How to implement this?

    Can you show me what you want maybe with annotated screenshots (you will need to upload images to an external file sharing site, like dropbox, and share the link with me.

    The pagination on your current results page comes from the theme template file.

    #227813

    Trevor
    Participant

    It needs to be on the results page. In that code I don’t see the results shortcode?

    It can work inside the results.php file, but not inside the if and while loops.


    Anonymous
    Inactive

    Hi everyone, I’m trying to figure out a small problem I’m having with the filter. I’ll try to explain as best as possible but I’m not very tech savvy so my apologies. Right now I have it set up as Display Results using Post Archives but when you filter, you get the correct results but the filter disappears. I also tried using the shortcode method but its not using the blog grid method in Avada. I understand it’s using the results.php super basic layout which i don’t want. Here is the site – http://www.immuware.com/news/

    Any help would be appreciated thank you!

    #227283

    Trevor
    Participant

    Thinking about this some more, that script may need to be on the page, not in our results.php file.

    #227280

    Trevor
    Participant

    The solution might necessitate some experimentation. It is necessary to initialize Page Builders shortcodes again after an Ajax call (so, if you turned off Ajax in our form, the issue is likely to go away).

    Try adding this script to the page (you can add it to the start of the results.php file, outside of a php block:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
        $(.search-filter-results).vc_js();
      });
    }(jQuery));</script>

    I am unsure if this will work. If it does not, I may need to ask our developer to take a look.

    #227023

    Anonymous
    Inactive

    Yes it does but whichever template I choose doesn’t affect the layout because it’s using the results.php template.

    #226955

    Trevor
    Participant

    Do you have the PHP code from the current page template for the while have posts part of the loop?

    You could probably edit our results.php – place the edited copy in the child theme sub-folder mentioned here:

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

    And replace that part of our exemplar code with that of your theme template?

    #226945

    In reply to: Infinite Scroll


    Anonymous
    Inactive

    Hi Trevor,

    Apologies I’ve only just gotten around to trying this out, at the minute I get both messages coming up and I’m not entirely sure why, this is my results.php file.

    <?php
    /**
    * Search & Filter Pro
    *
    * Sample Results Template
    *
    * @package Search_Filter
    * @author Ross Morsali
    * @link https://searchandfilter.com
    * @copyright 2018 Search & Filter
    *
    * 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() )
    {
    ?>
    <div class=”flex-grid” data-aos=”fade-up”>
    <?php
    while ($query->have_posts()){
    $query->the_post();
    ?>
    <div class=”RoleGridWrapper col”>
    <?php if( get_field(‘scrub_colour’) == ‘navy-blue’){ $postcolor = ‘#153F74’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘cornflower-blue’){ $postcolor = ‘#5184C4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mediterranean-blue’){ $postcolor = ‘#009EC7’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘ocean-blue’){ $postcolor = ‘#64BFD4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘pale-sky-blue’){ $postcolor = ‘#97BADE’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘dark-green’){ $postcolor = ‘#00A296’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mid-green’){ $postcolor = ‘#92CEBD’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘silver-grey’){ $postcolor = ‘#ABAAAB’; } ?>
    <div class=”roleContWrapper” style=”border-top: solid 10px <?php echo $postcolor; ?>”>
    <div class=”cardTAB”>
    <svg id=”scrubsIcon” data-name=”Layer 1″ xmlns=”http://www.w3.org/2000/svg&#8221; viewBox=”0 0 40 40″><title>Scrubs Icon</title><path style=”fill:<?php echo $postcolor; ?>;” d=”M39.6,7.22a40.13,40.13,0,0,0-13-4.12,1.11,1.11,0,0,0-1.39.72c-.43.91-.88,1.73-.92,1.8-1.72,3.28-3.54,6-4.18,6.19-.66-.16-2.48-2.63-4.25-5.63-.46-.76-.8-1.42-1.25-2.28a1.29,1.29,0,0,0-1.52-.77A37.94,37.94,0,0,0,.4,7.22a.78.78,0,0,0-.32,1L3.47,15a.79.79,0,0,0,.9.41l3.49-.87L6.78,36.11a.79.79,0,0,0,.79.83H32.43a.79.79,0,0,0,.79-.83L32.14,14.57l3.49.87a.79.79,0,0,0,.9-.41l3.39-6.78A.78.78,0,0,0,39.6,7.22Z”/></svg>
    </div>
    “>
    <h3 class=”postHeader”><?php the_title(); ?></h3>
    <div class=”postCATS”>
    <?php
    $categories = get_the_category();
    $parentCatName = get_cat_name($categories[0]->parent);
    if ( ! empty( $categories ) ) {
    ?>
    <span class=”parentCAT”><?php echo esc_html( $parentCatName ); ?></span>
    <?php
    }
    ?>
    </div>
    <p class=”postIntro”><?php the_field(‘brief_role_description’); ?></p>
    <div class=”readmoreWrapper”>
    <p class=”postreadmore” href=”<?php the_permalink(); ?>”>Learn more</p>
    </div>

    </div>
    </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
    }
    }
    ?>

    Can’t seem to see why it’s not choosing one or the other, the only way at the moment I can get it to find no results is to search for something that I know isn’t available.

    Thank you
    Scott

    #226404

    In reply to: Infinite Scroll


    Trevor
    Participant

    Are you using our shortcode display results method?

    If so, this is a modified exemplar results.php file to account for this behavior:

    <?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
     }
    }
    ?>
    #226284

    Trevor
    Participant

    I assume you are using custom results.php files, so can you upload the one for this page to a file sharing site and share the download link for that with me?

Viewing 10 results - 231 through 240 (of 1,224 total)