-
AuthorSearch Results
-
May 22, 2019 at 1:45 pm #212001
In reply to: Filter only gets applied after second time it's used
AnonymousInactiveUpdate:
Error is fixed. The search-results.php file we talked about was set in “Display results method”/”as an archive” option. After removing it, saving, changing to shortcode again, the form seems to not throw the error anymore.
However, it still doesn’t display results the first time it is applied.
If AJAX is enabled, the filter has to be applied twice, even with the default template.
If AJAX is disabled, it loads the archive of the selected filter, e.g. “/difficulties/advanced” if the advanced filter is applied. This is a problem, because the archive page loads the results with a different form, not the template one. So the initial page uses the template, but the results page does not.
May 22, 2019 at 1:41 pm #211999
AnonymousInactiveHi Trevor.
thanks for your reply – I now have it working as you instructed. Eg copied the results.php and modified the code as you suggested. And the setting is set to Use Shortcode.The only thing that is not displaying correctly is the submit button wording and the placeholder text.
I currently have it like this in my page:
[searchandfilter id=”284″ fields=”search” search_placeholder=”Enter a Batch No” submit_label=”Search”]
[searchandfilter id=”284″ show=”results”]On the page the input field reads as “Search …” and also the default wording on the Submit button eg “Submit”.
May 22, 2019 at 11:22 am #211993
TrevorParticipantTo not show any results until a search is made requires modification of the PHP template being used by the results page. For any method other than the ‘As a Shortcode’ Display Results method, that would mean modifying a theme template file, which is not within the scope of our support.
Modifying the Shortcode results.php file must be done in the child theme folder, as discussed here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
The code I gave you would work for this latter method, but I am unsure if it would work if used inside any theme template file.
May 22, 2019 at 10:23 am #211969
TrevorParticipantI need to know if you have this set as shown here:
https://www.screencast.com/t/jVW9z2FJ
If it is, then the results.php needs to be modified like this (where I have used the ID number of your form):
global $searchandfilter; $sf_current_query = $searchandfilter->get(85204)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your current results.php code here }
Make sure any files you modify are in the child theme folder (if you copy our results.php file, it needs to be in a sub-folder of the child theme, called search-filter, not our plugin folder or a parent theme folder). Do NOT edit the copy of results.php that is in our plugin templates folder, as it will be overwritten by updates.
May 21, 2019 at 10:44 am #211778In reply to: i want the see more button
TrevorParticipantAre you able to upload the customised results.php template file, that you are using, to a file sharing site, like dropbox, weshare, google drive, and share the download link with me so that I can look at the template code?
May 20, 2019 at 4:00 pm #211717In reply to: Wierd Glitch After Search
TrevorParticipantAre you able to upload the customised results.php template file, that you are using, to a file sharing site, like dropbox, weshare, google drive, and share the download link with me so that I can look at the template code?
May 13, 2019 at 12:59 pm #210960In reply to: How to change this string
TrevorParticipantIn that case, please see this documentation, especially the part about customising:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
After making the copy of the results.php file, edit that file and change the text string(s), and anything else you want to change.
May 10, 2019 at 10:15 am #210717In reply to: I don't know how to make it work with ACF
TrevorParticipant‘To hide’ part.
As you are using our Shortcode Display Results method, the guide to customising it is here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
Your results.php file will have these lines in it (27-46):
?> 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
You need to remove these.
With regard to the form, you also mentioned font sizing? I would use the browser developer tools inspector to work out what to change, and the gaps will be set as margins I would guess, but i would need to see a live link/URL to your search page so I can take a look.
May 9, 2019 at 12:20 pm #210565
TrevorParticipantAs you are using our Shortcode Display Results method, then the results.php needs to be modified like this (where I have used the ID number of your form):
global $searchandfilter; $sf_current_query = $searchandfilter->get(85204)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your current results.php code here }
Make sure any files you modify are in the child theme folder (if you copy our results.php file, it needs to be in a sub-folder of the child theme, called search-filter, not our plugin folder or a parent theme folder). Do NOT edit the copy of results.php that is in our plugin templates folder, as it will be overwritten by updates.
I am not sure what you mean by #2? Is the page URL you have given me not the default search page, or do you mean the one your theme uses?
May 4, 2019 at 8:29 pm #210154In reply to: How to remove Post Date on Results Page
TrevorParticipantIf you are using our Shortcode Display Results method. The guide to customising it is here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
Your results.php file will have this line in it:
<p><small><?php the_date(); ?></small></p>
You need to remove this.
-
AuthorSearch Results