-
AuthorSearch Results
-
May 16, 2016 at 9:21 pm #45680
In 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-filter
in 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 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.
May 3, 2016 at 7:26 pm #44623In reply to: custom theme search result problem
TrevorParticipantThanks. That template file is very specific to displaying searches within the theme and will not allow our search system to display (at least, not easily, but we may have to try that).
You have the search placed at the top of the right sidebar, yes? Is it possible to do this using a shortcode in this theme, and for the results page to have the results shortcode in it?
The results will not look so good, but that we can fix with a custom results.php file.
April 29, 2016 at 12:20 pm #44355In reply to: Configure not showing
AnonymousInactiveSays Error: The custom template file
results.php
cannot be found – go to Display Results tab to fixApril 29, 2016 at 12:17 pm #44354In reply to: Configure not showing
AnonymousInactiveThis is the output with results.php
http://www.thoughtmechanics.co.uk/search/?_sft_category=apartment
I will send you the result page with shortcodes, however the portfolio text is below image.
-
AuthorSearch Results