Forums Forums Search & Filter Pro S&F Pro with Avada search.php

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Anonymous
    #9768

    Hey,

    Just purchased the S&F Pro – great plugin!

    I am using the Avada theme and would like the Ajax search results to be displayed as a grid. How can I go about doing this? Should I use the existing Avada search.php template (and select the grid search results layout in the theme options) and modify it somehow? Or is there some way that I should modify the results.php template file that comes with the S&F Pro plugin?

    It seems from a previous post that you have some familiarity with the Avada theme – apologies if this is not the case.

    Thanks in advance,
    Dan

    Ross Moderator
    #9972

    Hey Daniel

    I’ll try to help – I’ve used Avada for very basic purposes but I am familiar and have done some implementations.

    First, make sure you are updated to the latest version of the plugin (1.4.0).

    What I think would be the best course of action is to duplicate search.php and give it a unique name – eg search-filter.php

    In this file you must comment out the custom query (as per instructions on this post)

    Then in S&F admin – go to “display results” and select “as archive”…

    Then scroll down, you will see use “custom template” – tick this and underneat enter “search-filter.php” or the filename of your template.

    Basically, now we have the search template working with your theme – but we are free to customise it…

    I think that if you change the grid search results option in the theme options that this will be respected in your template.

    If this does not work I would also recommend to goto the “advanced” tab, and ticking “force is_search to always be true”.

    Let me know how you get on 🙂

    Thanks

    Anonymous
    #9978

    Thanks for this Ross. I’ve tried the above (including forcing is_search to be true) however it seems that regardless of what my input to the search form is I get the “Couldn’t find what you’re looking for!” page, and the search form no longer visible.

    Ross Moderator
    #9980

    Ah you mean when you enable “force is_search to true”? If thats teh case leave it disabled then – its only there to help in some circumstances..

    What happens when you’ve disabled that option, and followed the steps above such as removing the custom query in the template?

    Thanks

    Anonymous
    #9991

    Ok I’ve disabled the is_search forcing, removed the query_posts() custom query from the Avada template file and set display results to “As an archive page” with the name of the new custom template in the textbox. I’ve then inserted the [searchandfilter id="XX"] shortcode into the page that I want to use for the search. It unfortunately still doesn’t seem to work.

    Ross Moderator
    #9995

    And you’ve replaced the XX above with your ID (sorry had to check!)?

    Can you send me a link to look at?

    Thanks

    Anonymous
    #10049
    This reply has been marked as private.
    Ross Moderator
    #10074

    Haha hey again…

    There is a line here (75) which might need to be modified:

    <?php if ( have_posts() && strlen( trim(get_search_query()) ) != 0 ) : ?>

    Basically, the loop (that goes through your results) will only be entered if there is a search query (ie a search term – ?s=searchterm in your URL)….

    So you probably should modify this line to:

    <?php if ( have_posts() ) : ?>

    🙂

    Anonymous
    #10087
    This reply has been marked as private.
    Ross Moderator
    #10098

    The best way to debug this is to disable ajax first…

    Then you will see when you submit the form still disappears – this is because you need to add the shortcode to the php template itself.

    Once you’ve done that, and your start page and your results page look the same then we can re-enable ajax 🙂

    Thanks

Viewing 10 posts - 1 through 10 (of 10 total)