Forums Forums Search Search Results for 'results.php'

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

  • Anonymous
    Inactive

    Hi Trevor,

    I’ve done what you’ve suggested by copying over the results.php using the code from the infinite scroll file and have changed the results to be shortcode. However, this still doesn’t fire the AJAX infinite scrolling 🙁 Are you able to have a look at what might be causing this please?


    Trevor
    Participant

    Why not try our shortcode method (to test) and use the infinite scroll results.php with that (you have to copy over the file to the child theme folder and rename it to results.php), see here for instructions:

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

    (the file has to be named results.php but needs the contents of the infinite scroll version)

    #209381

    Anonymous
    Inactive

    Ok, thank you! I think about it. I have one more question: I use Post Views Counter Plugin, and when i place pvc_post_views(); function inside results.php template (address:/wp-content/themes/mytheme/search-filter/results.php) My filtering results are crashing (display nothing), when i click on filter buttons. What i need to do?

    #208913

    Trevor
    Participant

    My apologies for the delay in replying. In the UK we have had a long 4 day national holiday weekend this last weekend.

    To your question. For example, argomenti?

    Did you make a custom version of the results.php file, as detailed here:

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

    It will require some custom code in that file, in the location/line where you want the terms output. For example, for argomenti, it would be something like this (but you can add your own HTML and classes etc):

    $taxonomy_terms = get_terms('argomenti');
    foreach($taxonomy_terms as $term){
      $terms[] = $term->name;
    }
    if(!empty($terms)) {
      echo join(", ", $terms);
      unset ($terms);
    }
    #208449

    Anonymous
    Inactive

    Here I have to add something, I have several pages and in each one I use a different personalized filter, each page corresponds to a department of Colombia, therefore, what we are looking for, is that the search result only brings results from that department, that’s why, if you go to the next two pages, you can see that the filter results are different.

    https://www.starpets.com.co/antioquia/
    https://www.starpets.com.co/cundinamarca/

    This I clarify, since after reviewing the help forum, I found this answer that you gave previously to a user https://support.searchandfilter.com/forums/topic/prevent-empty-search-fetching-results/#post -185868 but I do not know if it applies to my project, since here you indicate that you should replace the id of the page, but if there are several forms and each one has a different id, how can I achieve what you indicate?

    and so the code of my results.php file is displayed:

    <?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() )
    {
    ?>
    
    Found <?php echo $query->found_posts; ?> Results<br />
    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>
    
    <?php
    while ($query->have_posts())
    {
    $query->the_post();
    
    ?>
    <div>
    <h2>"><?php the_title(); ?></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 />
    <?php
    }
    ?>
    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>
    <?php
    }
    else
    {
    echo "No Results Found";
    }
    ?>

    I do not know if there is something wrong here too, because in the page where I’m trying to find the code, at the end of the results, this comes out:

    global $searchandfilter; $sf_current_query = $searchandfilter->get(2101)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()==””)) { echo ‘
    Nothing to see here folks!
    ‘; } else { // your template archive code/loop OR results.php code here }

    #208370

    Trevor
    Participant

    The guide for customization is here:

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

    You need to copy the results-infinite-scroll.php file to the search-filter sub folder of your child theme folder, and then rename that to results.php.

    You would need to add some PHP/HTML to create the link, like this:

    <div class="readmorelink"><a href="<?php the_permalink(); ?>">Read more ....</a></div>

    #208043

    Trevor
    Participant

    So, if we agree it is working now, try using your modified results.php file. If it does not work with that, then the content of that modified file is the issue.

    #207987

    Anonymous
    Inactive

    Hi Trevor,

    The page with the Search & Filter module: https://infocondensatieketel.be/checklist/ with settings > Using a Shortcode and the results.php (copy from search-filter-pro/templates) in the /search-filter folder in the Avada child theme.

    The search result shows the featured images of the respective posts with the images among each other, and without link to the product (= post).

    The only search criteria are 3 post categories (one category & 2 taxonomies) and the only results I want to show are the respective post titles with featured image, something like on https://infocondensatieketel.be/merken/remeha/ under ‘Alle condensatieketels’ but with title.

    Kind regards,

    Roel

    #207932

    Trevor
    Participant

    I just want to see how the form relates to a ‘standard’ results.php template, not to delete the one you have.


    Trevor
    Participant

    What Display Results Method are you using? If it is shortcode, then the guide for customization is here:

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

    You need to copy the results-infinite-scroll.php file to the search-filter sub folder of your child theme folder, and then rename that to results.php.

Viewing 10 results - 321 through 330 (of 1,224 total)