-
AuthorSearch Results
-
May 18, 2016 at 9:37 am #45835
In reply to: Extra lines in search box format
TrevorParticipantAre you still using the shortcode Display Result method? Did you follow the instructions here (about copying the results.php file to your theme folder):
http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/
You can then edit that copied file to make the HTML structure as you want.
May 16, 2016 at 9:59 pm #45682In reply to: Results not refreshing
AnonymousInactiveThank you, that would be great.
You need the original index.php template for that?The results.php is copied into my child-theme file.
Regards,
FrankMay 16, 2016 at 9:21 pm #45680In reply to: Results not refreshing
TrevorParticipantI can do that quite easily. Do this for now:
1. Create a folder in your theme folder called
search-filter.
2. Copy the file wp-content\plugins\search-filter\templates\results.php from the templates folder in to the newly created folder in your theme – wp-content\themes\your-theme-name\search-filter\results.phpMay 14, 2016 at 8:48 am #45546In reply to: Noindex, follow pagination
TrevorParticipantIt depends on the Display Result method that you have chosen. If you are using the shortcode method, you need to have (should already have) placed a copy of the provided results.php file in a sub-folder (named
search-filter) of your child theme folder. You can edit this file to do what you want.Any other method uses your theme’s own template files, and you will need to edit them, or ask the theme author for guidance.
May 11, 2016 at 1:14 pm #45273In reply to: Results no longer showing as they should
AnonymousInactiveHi Trevor, thanks for getting back to me so quickly.
To answer your questions:
#1 – I’m not sure when it happened, whether it was an update of S&F or an update of my theme – I have only noticed it recently.
#2 – Yes it uses results.php.
#3 – Yes I edited results.php and had it outputting the results as described above.
#4 – Yes I did.
#5 – I have backups going back to 14th April, but looking at the file from then and today’s file, I can’t see any difference between them (having had a quick look)?Thanks
Andy
May 11, 2016 at 1:07 pm #45272In reply to: Results no longer showing as they should
TrevorParticipantHi Andy
I suspect I know what has happened, and you may have already guessed, but, a few questions:
#1 This happened at an update of S&F?
#2 Your search setup uses the results.php template?
#3 Had you edited/modified that results.php file to output the results as you wanted?
#4 Did you make a folder calledsearch-filterin your theme/child theme folder and put the modified version of results.php in there?
#5 Do you have a backup of this file from before the update?May 11, 2016 at 12:01 pm #45267Topic: Results no longer showing as they should
in forum Search & Filter Pro
AnonymousInactiveHi guys,
I’ve noticed something strange today – the layout of results is no longer following the way I have it set up in the results.php file.
I had it set up so that results were shown in a grid of four, with a thumbnail and post title, both of which linked to the post itself. This now seems to be being ignored, with an excerpt being shown and a full size image – which although not a major issue, will cause users to have to scroll through loads of info rather than the ‘gallery’ style I want.
This has only changed recently (although I’m not sure when exactly) so it’s a bit weird, I can only assume it’s down to either a S&F update or a theme update, but not sure which?
Thanks
Andy
May 10, 2016 at 7:18 pm #45212In reply to: Slow SF Page With Many Results
AnonymousInactiveNo problem – speedy recovery.
I think the problem lies with the code I have customized here for results.php in SFpro. It seems that maybe my conditional for the second part doesn’t take into consideration the arguments of the query. I end up with all the posts in my db generating equivalent modals. :
<?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 * */ // $term_list = wp_get_post_terms($post->ID, 'product_features', array("fields" => "all")); // foreach($term_list as $term_single) { // echo $term_single->slug; //do something here // } if ( $query->have_posts() ) { ?> <div class=""> <?php while ($query->have_posts()) { $query->the_post(); ?> <a class="col-md-6 col-lg-4 col-sm-6"> <article class="module-container eModal-post-<?php the_ID();?>" href="<?php the_permalink();?>"> <h3><?php the_title();?></h3> </article> </a> <?php if( get_field( "demo_module" )) { echo do_shortcode( "[modal id='post-". get_the_ID() ."' size='large' title='". get_the_title() ."']". "<div class='col-md-8'>" . get_the_content() . "<div class='demo-module'>" . "<a class='cta-button-v4' href='" . get_field( "demo_module" ) . "' target='_blank'>Download Demo Module</a>". "</div>" . "</div>" . "<div class='col-md-4'>" . do_shortcode("[module_author]") . "</div> <div class='col-md-12'><div class='cta-module'>" . do_shortcode("[cta_module_shortcode]") . "</div></div>" . do_shortcode("[wpdm_package id='". get_the_ID() . "']"). "[/modal]" ); } else { echo do_shortcode( "[modal id='post-". get_the_ID() ."' size='large' title='". get_the_title() ."']". "<div class='col-md-8'>" . get_the_content() . "</div>" . "<div class='col-md-4'>" . do_shortcode("[module_author]") . "</div> <div class='col-md-12'><div class='cta-module'>" . do_shortcode("[cta_module_shortcode]") . "</div></div>" . do_shortcode("[wpdm_package id='". get_the_ID() . "']"). "[/modal]" ); } ?> <?php } ?> </div> <?php } else { echo "No Such Modules"; } ?>May 6, 2016 at 6:41 pm #44951In reply to: How do I hide initial results?
TrevorParticipantSo, it is relatively simple if you are using the Shortcode Display Results method. See the documentation:
http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/
See how it is using a template called results.php?
This is 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 /> 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() ) { 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"; } ?>And here is it modified:
<?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() ) { global $searchandfilter; $sf_current_query = $searchandfilter->get(1526)->current_query(); if ($sf_current_query->is_filtered()) { ?> 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()) { 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"; } ?>replace 1526 with the id of your search form.
May 3, 2016 at 8:40 pm #44633In reply to: How do I hide initial results?
AnonymousInactiveI had to put back the original code for the client. When I add the modified results.php code everything disappears. We only want the results to go away prior to the search. Let me know if I need to put the modified code back in for you to troubleshoot it.
-
AuthorSearch Results
Search Results for 'results.php'
-
Search Results
-
Hi guys,
I’ve noticed something strange today – the layout of results is no longer following the way I have it set up in the results.php file.
I had it set up so that results were shown in a grid of four, with a thumbnail and post title, both of which linked to the post itself. This now seems to be being ignored, with an excerpt being shown and a full size image – which although not a major issue, will cause users to have to scroll through loads of info rather than the ‘gallery’ style I want.
This has only changed recently (although I’m not sure when exactly) so it’s a bit weird, I can only assume it’s down to either a S&F update or a theme update, but not sure which?
Thanks
Andy