Forums › Forums › Search & Filter Pro › Infinite Scroll issues
- This topic has 6 replies, 2 voices, and was last updated 7 years, 5 months ago by
Anonymous.
Viewing 6 posts - 1 through 6 (of 6 total)
-
Trevor(Private) January 18, 2018 at 1:40 pm #153254
You will need to follow the instructions for making a custom results.php file here:
However, you need to change the contents of the standard results.php file to the content of the infinite scroll version, which look like this:
<?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 { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } ?>
Anonymous(Private) January 18, 2018 at 1:47 pm #153258Hi, thanks for coming back to me.
For one of the custom results.php files I have used the infinite scroll version, my code looks like this (below).
I have also used a form without a custom results.php file, so it should have used the standard results.php file stored within the plugin.
<?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() ) { ?> <div class="filter-grid"> <div class='search-filter-results-list'> <?php while ($query->have_posts()) { $query->the_post(); $thumb_url = get_post_meta( get_the_ID(), 'news_thumbnail', true ); $link = get_post_meta( get_the_ID(), 'news_link', true ); if ( empty($link) ) { $link = get_the_permalink(); } ?> <div class="x-column x-sm x-1-3 item"> <div class="category"><?php echo get_the_term_list(get_the_ID(), 'news', '', ', ', ''); ?></div> <a href="<?php echo $link; ?>"> <div class="image"> <img src="<?php echo $thumb_url; ?>" width="100%" /> </div> <div class="content"> <h3><?php the_title(); ?></h3> <p><?php echo get_the_date( 'd.m.y' ); ?></p> </div> </a> </div> <!-- .item --> <?php } ?> </div> <!-- .search-filter-results-list --> </div> <!-- #filter-grid --> <?php } else { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } ?>
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)