-
AuthorSearch Results
-
September 16, 2020 at 11:17 am #259625
In reply to: URL Change
TrevorParticipantIf you browse through the plugins files, there is a templates folder. Look at the code in the results.php file. The code in that file is based on the basic code structure suggested in the WordPress Codex.
You might also look at the theme files you have and see if there is one named archive.php
If you want only a single page for results, you could use our Shortcode method and modify the code in the results.php template file. Many users do this, there is a guide to customising in our documentation on how to start this.
TrevorParticipantAs you are using our shortcode method the display of the results comes from our results.php file. You would need to customise it as described (in basic form) here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
You need to remove the line:
<p><small><?php the_date(); ?></small></p>
September 4, 2020 at 10:01 am #258483In reply to: auto open media and pagination
TrevorParticipantI apologise for the delay, I ran out of time yesterday.
If you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.To make the pagination look nicer, install the free WP-PageNavi plugin and delete these lines in the results.php template file:
<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>
To show only a link to the pdf itself, replace these lines:
<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>
With this:
<h2><a href="<?php echo esc_url(wp_get_attachment_url(get_the_ID () , false )); ?>"><?php the_title(); ?></a></h2>
August 31, 2020 at 2:31 pm #257846In reply to: How to hide search results count?
TrevorParticipantIf you are using the Shortcode display results method …
If you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
However, I think you have missed this crucial step, based on your post:
Rather than copy the results.php file to your theme sub-folder, copy the results-infinite-scroll.php file, and then rename it to results.php
The code for this file is different, to account for how the Infinite Scroll works.
That will give you a results.php file you can edit, in a sub-folder named search-filter in your theme folder.
So, look for this code in the results.php template file:
Found <?php echo $query->found_posts; ?> Results<br />
… and delete that line.
Please note that in the UK today is a public holiday, so further replies may be delayed.
August 21, 2020 at 10:42 am #256885In reply to: No search results
TrevorParticipantI apologise for the delay Jens, I ran out of time yesterday.
If you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.Would you want to show that after you search? My guess is yes. So, look for this code in the results.php template file:
Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
And change that to (I think this will work):
global $searchandfilter; $sf_current_query = $searchandfilter->get(30408)->current_query(); if (!((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()==""))) { Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> }
You can change anything else you want also. For example, to make the pagination look nicer, install the free WP-PageNavi plugin and delete these lines:
<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>
August 21, 2020 at 10:01 am #256873
TrevorParticipantIt isn’t, I am sorry. Two possibilities I can think of. One is to change the template so that the change is inside an if condition, and you check to see what page/post you are on? That would be my first choice. The other option is to make a duplicate form and use that form instead on the page, and number the results.php (as suggested in those same instructions you mentioned).
August 20, 2020 at 10:59 pm #256826
AnonymousInactiveGood afternoon,
I wanted to alter the output of results.php for a site I am building. Your instructions suggest creating an alternate results.php template in my child theme, which would normally be fairly straightforward. However, the child theme in question here is running in a total of 50 different places and I only want to make this modification on one of those properties.
Is it possible to locate the new results.php file in a different location (like a separate plugin) and have it still be available to your product?
Thanks!
August 20, 2020 at 9:17 am #256692In reply to: No pagination
TrevorParticipantAre you using the Shortcode Display Results Method? If so, start with this guide (if you have not already):
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
Having gotten the copy into your child theme sub folder, install the free WP-PageNavi plugin:
https://wordpress.org/plugins/wp-pagenavi/
If that gives you what you want, you would then need to edit that results.php file to remove the parts of the HTML/PHP that you no longer need.
August 20, 2020 at 9:16 am #256688In reply to: No pagination
TrevorParticipantAre you using the Shortcode Display Results Method? If so, start with this guide (if you have not already):
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
Having gotten the copy into your child theme sub folder, install the free WP-PageNavi plugin:
https://wordpress.org/plugins/wp-pagenavi/
If that gives you what you want, you would then need to edit that results.php file to remove the parts of the HTML/PHP that you no longer need.
August 20, 2020 at 9:09 am #256684In reply to: Elements are rendered only for a first page.
TrevorParticipantIf you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.Then, see the guidance in this post:
-
AuthorSearch Results
-
Search Results
-
Good afternoon,
I wanted to alter the output of results.php for a site I am building. Your instructions suggest creating an alternate results.php template in my child theme, which would normally be fairly straightforward. However, the child theme in question here is running in a total of 50 different places and I only want to make this modification on one of those properties.
Is it possible to locate the new results.php file in a different location (like a separate plugin) and have it still be available to your product?
Thanks!