Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 391 through 400 (of 1,224 total)
  • Author
    Search Results
  • #197179

    Trevor
    Participant

    If using the Shortcode method, the file must be called results.php, but the content needs changing to that from the results-infinite-scroll.php

    Is this what you did?

    #197174

    Trevor
    Participant

    Hi Ryan

    I think this very much abridged results.php file is all you need:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      https://searchandfilter.com
     * @copyright 2018 Search & Filter
     * 
     * Note: these templates are not full page templates, rather 
     * just an encaspulation of the your results loop which should
     * be inserted in to other pages by using a shortcode - think 
     * of it as a template part
     * 
     * This template is an absolute base example showing you what
     * you can do, for more customisation see the WordPress docs 
     * and using template tags - 
     * 
     * http://codex.wordpress.org/Template_Tags
     *
     */
    
    if ( $query->have_posts() )
    {
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		if ( has_post_thumbnail() ) {
            ?>
    		<div>
    			<p><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail("small"); ?></a></p>
    		</div>
    		<hr />
    		<?php
    		}
    	}
    }
    else
    {
    	echo "No Results Found";
    }
    ?>

    It might cause you some CSS issues, I am not sure. However, much of the CSS you wrote to hide stuff would not be needed.


    Anonymous
    Inactive

    Hi Trevor,

    Aha… of course, sounds obvious! So instead I should try to use the script in Elementor somewhere, I guess…

    I used it on multiple locations in the results.php (not at the same time, by the way), but if the site isn’t using that file, obvious it doesn’t show ๐Ÿ˜‰

    Just asked Elementor Pro for a bit of assistance (which page I should attack with the Java ๐Ÿ˜‰

    I’ll let you know if they have some good intel, haha!

    Thanks so far !

    Kind regards,

    Klaas


    Trevor
    Participant

    Did you make a typo there Klaas? You aren’t using the Shortcode method, so it doesn’t use a results.php template file. Instead, you are using the Custom method, which uses the Elementor post element.

    How or where did you apply the javascript?


    Anonymous
    Inactive

    Hi Trevor,

    It’s me again… so sorry ! ๐Ÿ˜‰

    Ehmmm.. tried to apply the JS to the results.php, but so far no luck yet, (the pics stick to the posts within the first filter attempt, but as soon as you use another/next filter, the pics still stay away, although the post DO refresh according the filter requests, nicely.)

    So could you please help me ? Would it help if we/I post the complete code ? Somehow I have the idea that the location of the JS code inside the results.php might be wrong ?

    Kind regards,

    Klaas

    #196457

    Trevor
    Participant

    No templates folder. results.php goes directly in to the search-filter folder. See this page:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    #196447

    Anonymous
    Inactive

    Thanks, Trevor. So to copy the results.php to my child theme and customize, would I create a folder called “search-filter” at the root of the child theme, then under that add another folder called “templates” housing the templates.php? I’m assuming that the folder structure would need to match.

    Thanks for all your help!

    #196427

    Trevor
    Participant

    You can edit that file to your heart’s content. Some people almost completely re-write it. It is only intended as a simple exemplar. Often, you will find theme template use a similar If and while structure, and you can often copy and paste chucks of code from the theme templates into our results.php file.

    Make sure the copy you are editing is within your child theme folder, in a sub folder called search-filter.

    #196033

    In reply to: Translate Pagination


    Trevor
    Participant

    What Display Results Method are you using? If you are using Shortcode, then you need to have, or must now, follow the customisation guide here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    And then edit the results.php file now in your chuild theme folder, and find those words and change them and save.

    #195388

    Trevor
    Participant

    In the plugin folder, in a templates sub-folder, are two exemplar files, and our plugin uses the one named results.php by default. This documentation tells you to place one of these two files in a search-filter sub-folder of your child theme. Obviously, if you are using infinite scroll, copy that one, otherwise copy the other.

    Then, with that file in the new search-filter sub-folder, rename the file to results.php if needed. It must always be named that, or named the same ID as each for the forms (allows more than one template to be used).

    The documentation for this is here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

Viewing 10 results - 391 through 400 (of 1,224 total)