Search Results for 'results.php'

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

Viewing 10 results – 1,211 through 1,220 (of 1,344 total)
  • Author
    Search Results
  • #27773

    Anonymous
    Inactive

    Hi,

    I’m using Timber to render Twig templates to format my search results via results.php. I’ve added a conditional tag to load a new twig template if a specific page is calling the search results.

    results.php:
    <?php
    if (is_page(ID)) {
    $templates = array(‘special-template.twig’);
    } else {
    $templates = array(‘general-template.twig’);
    }

    ….

    This works fine on “Special Page” — i.e. the special-template results are loaded. However, I want to use AJAX to filter the results. When I try an AJAX filter, is_page returns FALSE and the “general-template.twig” is loaded for my search results.

    Any advice? Or is this the wrong approach for what I want to accomplish?

    Thanks!

    #27677

    Ross
    Keymaster

    Hi Vikki

    I got slightly confused, but if you are using the results.php template provided (but copied in your theme folder) you will notice the line:

    Found <?php echo $query->found_posts; ?> Results<br />

    So this is already being displayed in your results – the variable you need is $query->found_posts

    Thanks

    #27465

    Ross
    Keymaster

    I can see that your <p> tags around the image are not properly opened and closed

    You open the <p> inside the <a> but the close it outside the </a>

    This is not really a S&F issue anymore, if you default to the supplied results.php in the S&F template folder (of the plugin) do you see any out of place <p> tags?

    #27451

    Anonymous
    Inactive

    Hi Ross

    Thanks I have copied results.php into my new search-filter folder as requested. Please can I have the code?

    Thanks
    Vikki

    #27246

    Anonymous
    Inactive

    But I can’t find the page that the S&F is using as results.
    If I put the flag on use custom template (with the field url blank) works without not.

    Whatever change I make to this file: search-filter-pro/templates/results.php nothing happens

    #27070

    Anonymous
    Inactive

    To sum it up my search result page is this: framework/global/_index.php

    I can’t use that URL on your plugin. So I suppose yours is taking results from your file results.php

    #26069

    Anonymous
    Inactive

    Hi Ross I am using a custom template for my results for display purpose. It seems to work now so I hope nothing else will change. It seems to get my results.php template from my theme directory. Maybe because that is already in the database from before this upgrade? I’m not sure.

    #26063

    Anonymous
    Inactive

    Hello,

    I am getting an error now Call to a member function have_posts() on a non-object in /home/domain/public_html/wp-content/themes/mytheme/search-filter/results.php on line 25

    This is the page: http://wfsaustralia.com/clients/

    Your help is appreciated. Thank you.

    #25883

    Anonymous
    Inactive

    Thanks for the feedback Ross,

    2 – I have all your recommendations on. you can see the image with the general panel http://imgur.com/xWt2XPs

    3 – i tried costumize the results.php to reach my point: i put that code:if ( $_GET["_sft_portfolio_category"] && $query->have_posts() ) instead of the original one: if ( $query->have_posts() )
    This can generate any problem?

    I really need the field relationship working.

    Thanks a lot once again

    #24905

    Ross
    Keymaster

    Jamie

    I’m really surprised at your reaction.

    I logged in to your site. Created a basic search form, and set it up on a page working.

    Now, when I try to access the page I created for you its all messed up.

    If since me creating it for you it stopped working, then YOU must have changed something in your environment/setup without realising it has affected the work I have done.

    Actually, I just logged in to your site, to check the settings of the form I created for you, and guess what – I can see you have changed the settings – and clearly broken it.

    If you are a developer I’m sure you will know the difference between a Results URL and a template filename?

    Well, in the “Results URL” box, you keep changing this to results.php – you do not specify the template name here, you paste the URL of a page with the Results shortcode (this can be found in the “shortcode” metabox)…

    Again, I have created ANOTHER demo for you, it is completely working, cross browser and everything (I even tested).

    So please, try to actually read what the various fields in the settings do before getting angry.

    Thanks

    Link in the following private message.

Viewing 10 results – 1,211 through 1,220 (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.