-
AuthorSearch Results
-
November 16, 2018 at 3:57 am #193790
Topic: Modal won't fire when loaded via Ajax.
in forum Search & Filter Pro
AnonymousInactiveI have a model that displays additional content inside my custom results template. It works great as long as it is not loaded via Ajax. Any ideas how to remedy this? I’m using Reveal modal from Zurb. Here’s my here.
October 5, 2018 at 6:21 pm #190261In reply to: Nothing found message not showing
TrevorParticipantAh. Something like this then (a modification of that file):
<?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 } } ?>
September 28, 2018 at 3:13 pm #189646In reply to: Various Issues
TrevorParticipantThe 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; }
September 26, 2018 at 9:20 am #189362In reply to: Having a few issues with the search results
TrevorParticipantI used WP File Manager (whioch you had already got installed), and I followed these instructions:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
And changed the results.pgp code to this:
<?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><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><br /><?php the_excerpt(); ?></p> <?php if ( has_post_thumbnail() ) { ?> <p><a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail("small"); ?> </a></p> <?php } ?> </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"; } ?>
September 17, 2018 at 1:40 pm #188561In reply to: Little improvements
TrevorParticipantYou can replace the contents of the results.php with this:
<?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; ?> Companies<br /> <?php while ($query->have_posts()) { $query->the_post(); ?> <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>'; } ?> </div> <hr /> <?php } } else { echo "No Results Found"; } ?>
I am not sure what you mean by:
The infinite scroll should be bigger (double size) How can I increase it?
and also
The displayed results (the names of the companies) should not link to the Post-site. They should link to my individual site.
September 13, 2018 at 2:36 pm #188335In reply to: Open result links in same window
AnonymousInactive<?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="results-found"> Found <?php echo $query->found_posts; ?> Results<br /></div> <div class='search-filter-results-list'> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class='search-filter-result-item'> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> <h2><a href="<?php the_permalink(); ?>",><?php the_title(); ?></a></h2> </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 } ?>
September 13, 2018 at 6:48 am #188296In reply to: Remove the text "…Results Found" and "Page… of …"
TrevorParticipantTo the error; if it only randomly happens, it will be hard to track down, but my first though is that it must be something to do with these settings:
https://www.screencast.com/t/EoLysM5EqD
Maybe try changing what they are currently set at?
Assuming you are using the Shortcode Display Results method:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
If so, I assume you copied the results-infinite-scroll.php template instead of the results.php template when you followed the customising guide there? It still needs to be named results.php in the child theme, so it would need renaming. It looks like this by default:
<?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 } ?>
On line 29 is this:
Found <?php echo $query->found_posts; ?> Results<br />
Simply delete that line and save.
As to the loading icon, this thread might help:
June 14, 2018 at 11:19 am #180335In reply to: Custom message on infinite scroll search no results
TrevorParticipantThis is our standard infinite scroll results.php template modified to have a no results message. Use this as a starting point:
<?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 } } ?>
June 11, 2018 at 6:02 am #180132In reply to: PHP Code to display number of results
TrevorParticipantWhat Display Results Method are you using? If it is your own template, then you would need to know the name of the query variable. The default os for it to be named
$wp_query
, so some sample code would look like this:<p>Found <?php echo $wp_query->found_posts; ?> Results</p>
May 17, 2018 at 11:07 am #178171In reply to: Posts Display only with the featured image
TrevorParticipantHi, this is the new custom results.php file. I cannot access this on your site (it seems to be locked), but this is the content I think you need (I therefore cannot test it):
<?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 /> 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> <div class="ptb_loops_wrapper clearfix ptb_grid3"> <?php while ($query->have_posts()) { $query->the_post(); ?> <article id="post-<?php the_ID();?>" class="ptb_post clearfix post-32080 padi_courses type-padi_courses status-publish has-post-thumbnail hentry "> <div class="ptb_items_wrapper entry-content" itemscope="" itemtype="https://schema.org/Article"> <div class="ptb_col ptb_col1-1 ptb_col_first"> <div class="ptb_module ptb_title"> <h2 class="ptb_post_title ptb_entry_title" itemprop="name"> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h2> </div> <div class="ptb_module ptb_thumbnail"> <figure class="ptb_post_image clearfix"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) the_post_thumbnail("small"); ?> </a> </figure> </div> </div> </div> </article> <?php } ?> </div> 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"; } ?>
-
AuthorSearch Results
-
Search Results
-
I have a model that displays additional content inside my custom results template. It works great as long as it is not loaded via Ajax. Any ideas how to remedy this? I’m using Reveal modal from Zurb. Here’s my here.