Search Results for 'results.php'

Forums › Forums › Search › Search Results for 'results.php'

Viewing 10 results – 431 through 440 (of 1,344 total)
  • Author
    Search Results
  • #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.

    #196409

    Anonymous
    Inactive

    Hello. Within the results.php, can we add a <div> wrapping the featured image, as well as a <div> wrapping and post details? I have been working with this plugin for some time and the only thing I see which is a downside is not having the ability to control the layout since the elements are not housed in wrapping containers.

    Additionally, could the logic be re-written so that there are never any empty <p></p> tags rendered? This is a problem that causes formatting issues as well.

    <div class=”postFeatureGraphic”>
    <?php
    if ( has_post_thumbnail() ) {
    echo ‘<p>’;
    the_post_thumbnail(“small”);
    echo ‘</p>’;
    }
    ?>
    </div>
    <div class=”postDetails”>
    <h2>“><?php the_title(); ?></h2>
    <p class=”postDate”><?php echo get_the_date(); ?></p>
    <p><?php the_category(); ?></p>
    <p class=”postExerpt”><?php the_excerpt(); ?></p>
    </div>

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


    Anonymous
    Inactive

    Have the plugin working, but get some strange behavior in the results list I can’t figure out.

    If there is NOT an Excerpt added for the post, then in its place appears the text “Download File [1.4MB]” (file size varies), but every post will have it unless there was an excerpt saved for the post.

    Download File will disappear once an excerpt is added for the post.

    If I remove the call for the_excerpt in the results.php file then the
    Download File text goes away and obviously all the excerpts if there was one.

    Is it some kind of placeholder text?
    Any clues on what is causing this text to appear and how to get rid of it?

    Any help is appreciated,
    Ray

    Search & Filter Pro v2.4.6

Viewing 10 results – 431 through 440 (of 1,344 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.