-
AuthorSearch Results
-
May 10, 2018 at 2:11 pm #176841
In reply to: Displaying results on load
TrevorParticipantAre you using our shortcode display results method? If so, edit the results.php file to use code like this:
global $searchandfilter; $sf_current_query = $searchandfilter->get(1024)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your template archive code/loop OR results.php code here }
Change 1024 to the ID number of your form (from the form shortcode).
Make sure you are working on a copy of the results.php file in a search-filter sub-folder of your theme/child theme folder, and not the original in our plugin template folder.
May 10, 2018 at 11:42 am #176811In reply to: Issue customizing results with multiple search forms
TrevorParticipantThe file either has to be named results.php OR …
Let us assume that the form ID is 1234 (from the shortcode you see in the form, or indeed the post ID of the form), then if you named the file 1234.php, it would use that. The results shortcode you use does not change.
May 9, 2018 at 10:12 am #176626In reply to: Hide results list by default
TrevorParticipantAs you are if you are using our shortcode display results method (and therefore our results.php template file), it needs to be edited to look like this:
global $searchandfilter; $sf_current_query = $searchandfilter->get(1024)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your template archive code/loop OR results.php code here }
Change 1024 to the ID number of your form (from the form shortcode).
Make sure you are working on a copy of the results.php file in a search-filter sub-folder of your theme/child theme folder, and not the original in our plugin template folder.
May 8, 2018 at 9:37 pm #176563In reply to: Page Not Found – Error 404 Page
TrevorParticipantYou would need to customise the results.php file to make HTML that would achieve the columns. This is the documentation you need to start with:
You might other pages in your theme where you could copy HTML from.
May 8, 2018 at 1:51 pm #176368In reply to: Posts Display only with the featured image
TrevorParticipantHi
I do not think you followed the instructions that I gave you in this reply:
As I cannot see the search-filter folder nor the copy results.php file. I can do it for you, but it would mean (temporarily) adding a plugin (which you can remove if you don’t want to keep it)?
May 8, 2018 at 11:57 am #176320
TrevorParticipantThis would depend on the layout template being used for your page. That would depend on your theme or page builder/content plugin that you are using, or, if you are using our shortcode display results method and our results.php template file, it would look like this:
global $searchandfilter; $sf_current_query = $searchandfilter->get(1024)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your template archive code/loop OR results.php code here }
Change 1024 to the ID number of your form (from the form shortcode).
May 8, 2018 at 10:10 am #176289In reply to: Posts Display only with the featured image
TrevorParticipantHi
The standard grids in Themify will not allow our plugin to filter their content, so the solution is to use the Shortcode method, which is what you have done. Then, it is necessary to modify the standard results.php template file from our plugin to meet your needs. The documentation for this is here:
With the copy of results.php in your child theme folder (in the search-filter sub-folder), that file can now safely be edited.
Do you have an example page, elsewhere in your site, of what the page grid would need to look like already made in Themify, as I could use that to suggest what edits to the HTML and PHP are needed?
May 7, 2018 at 11:22 am #176099
TrevorParticipantIt does indeed make sense. Here is how you would code what you want to do:
global $searchandfilter; $sf_current_query = $searchandfilter->get(1024)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // your template archive code/loop OR results.php code here }
Change 1024 to the ID number of your form (from the form shortcode).
May 2, 2018 at 5:03 pm #175410In reply to: Duplicate search results
TrevorParticipantWould you take a little look at the test page you made? I have done a little bit of work in the results.php file. Do the duplicates appear there now?
May 2, 2018 at 9:23 am #175285In reply to: Duplicate search results
TrevorParticipantI have narrowed it down to the way your theme is getting the posts. I suspect it is modifying the posts after the wp_query is run, probably using pre_get_posts.
I do not have full access to your server, but need to explore the shortcode method a bit more. Can you follow the customising guide here, so that there is a copy of the results.php in a search-filter sub-folder of your YC2017 theme folder?
-
AuthorSearch Results