Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 311 through 320 (of 1,224 total)
  • Author
    Search Results
  • #212001

    Anonymous
    Inactive

    Update:

    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.


    Anonymous
    Inactive

    Hi 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”.


    Trevor
    Participant

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


    Trevor
    Participant

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

    #211778

    Trevor
    Participant

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

    #211717

    Trevor
    Participant

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

    #210960

    Trevor
    Participant

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

    #210717

    Trevor
    Participant

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


    Trevor
    Participant

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

    #210154

    Trevor
    Participant

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

Viewing 10 results - 311 through 320 (of 1,224 total)