Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 531 through 540 (of 1,224 total)
  • Author
    Search Results
  • #176841

    Trevor
    Participant

    Are 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.

    #176811

    Trevor
    Participant

    The 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.

    #176626

    Trevor
    Participant

    As 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.

    #176563

    Trevor
    Participant

    You 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:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    You might other pages in your theme where you could copy HTML from.

    #176368

    Trevor
    Participant

    Hi

    I do not think you followed the instructions that I gave you in this reply:

    https://support.searchandfilter.com/forums/topic/posts-display-only-with-the-featured-image/#post-176289

    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)?


    Trevor
    Participant

    This 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).

    #176289

    Trevor
    Participant

    Hi

    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:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    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?


    Trevor
    Participant

    It 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).

    #175410

    Trevor
    Participant

    Would 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?

    #175285

    Trevor
    Participant

    I 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?

Viewing 10 results - 531 through 540 (of 1,224 total)