Forums Forums Search & Filter Pro Avada integration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #79822

    Hi,

    I have the most upto date Avada installed 5.0.6 and Search & Filter Pro 2.2.0.

    I have read “https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/#h-bad-template” and the only applicable change I can find is:

    Replace:

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

    With

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

    any other mentioned changes such as:

    To get around this (also applies to some other themes) you need to look for query_posts, get_posts, WP_Query in your template and remove it.

    What I do in Avada to make it work is, duplicate search.php and call it search-filter-results.php, on around line 71 there is a query_posts – I simply remove this line – then in S&F settings, I set the custom template to search-filter-results.php and all works ?

    I cannot find the mentioned line 71.

    Any help would be very much appreciated and I will post my search.php next.

    Anonymous
    #79823

    <?php

    // Do not allow directly accessing this file.
    if ( ! defined( ‘ABSPATH’ ) ) {
    exit( ‘Direct script access denied.’ );
    }
    ?>
    <?php get_header(); ?>
    <div id=”content” <?php Avada()->layout->add_class( ‘content_class’ ); ?> <?php Avada()->layout->add_style( ‘content_style’ ); ?>>
    <?php if ( have_posts() && 0 != strlen( trim( get_search_query() ) ) ) : ?>

    <?php if ( ‘bottom’ == Avada()->settings->get( ‘search_new_search_position’ ) ) : ?>
    <?php get_template_part( ‘templates/blog’, ‘layout’ ); ?>
    <div class=”fusion-clearfix”></div>
    <?php endif; ?>

    <?php if ( ‘hidden’ != Avada()->settings->get( ‘search_new_search_position’ ) ) : ?>
    <div class=”search-page-search-form search-page-search-form-<?php echo Avada()->settings->get( ‘search_new_search_position’ ); ?>”>
    <?php
    /**
    * Render the post title
    */
    echo avada_render_post_title( 0, false, esc_html__( ‘Need a new search?’, ‘Avada’ ) );
    ?>
    <p><?php esc_html_e( ‘If you didn\’t find what you were looking for, try a new search!’, ‘Avada’ ); ?></p>
    <form class=”searchform seach-form” role=”search” method=”get” action=”<?php echo home_url( ‘/’ ); ?>”>
    <div class=”search-table”>
    <div class=”search-field”>
    <label class=”screen-reader-text” for=”searchform”><?php _e( ‘Search for:’, ‘Avada’ ); ?></label>
    <input id=”searchform” type=”text” value=”” name=”s” class=”s” placeholder=”<?php esc_html_e( ‘Search …’, ‘Avada’ ); ?>”/>
    </div>
    <div class=”search-button”>
    <input type=”submit” class=”searchsubmit” value=”” />
    </div>
    </div>
    </form>
    </div>
    <?php endif; ?>

    <?php if ( ‘top’ == Avada()->settings->get( ‘search_new_search_position’ ) || ‘hidden’ == Avada()->settings->get( ‘search_new_search_position’ ) ) : ?>
    <?php get_template_part( ‘templates/blog’, ‘layout’ ); ?>
    <?php endif; ?>

    <?php else : ?>

    <div class=”post-content”>

    <?php echo Avada()->template->title_template( esc_html__( ‘Couldn\’t find what you\’re looking for!’, ‘Avada’ ) ); ?>
    <div class=”error-page”>
    <div class=”fusion-columns fusion-columns-3″>
    <div class=”fusion-column col-lg-4 col-md-4 col-sm-4″>
    <h1 class=”oops”><?php esc_html_e( ‘Oops!’, ‘Avada’ ); ?></h1>
    </div>
    <div class=”fusion-column col-lg-4 col-md-4 col-sm-4 useful-links”>
    <h3><?php esc_html_e( ‘Helpful Links:’, ‘Avada’ ); ?></h3>
    <?php $circle_class = ( Avada()->settings->get( ‘checklist_circle’ ) ) ? ‘circle-yes’ : ‘circle-no’; ?>
    <?php wp_nav_menu( array(
    ‘theme_location’ => ‘404_pages’,
    ‘depth’ => 1,
    ‘container’ => false,
    ‘menu_class’ => ‘error-menu list-icon list-icon-arrow ‘ . $circle_class,
    ‘echo’ => 1,
    ) ); ?>
    </div>
    <div class=”fusion-column col-lg-4 col-md-4 col-sm-4″>
    <h3><?php esc_html_e( ‘Try again’, ‘Avada’ ); ?></h3>
    <p><?php esc_html_e( ‘If you want to rephrase your query, here is your chance:’, ‘Avada’ ); ?></p>
    <?php echo get_search_form( false ); ?>
    </div>
    </div>
    </div>
    </div>
    <?php endif; ?>
    </div>
    <?php do_action( ‘avada_after_content’ ); ?>
    <?php get_footer();

    /* Omit closing PHP tag to avoid “Headers already sent” issues. */

    Trevor
    #79859

    I suspect that the notes refer to Avada 4, as Avada 5 is relatively new. Recent threads show users now using the Shortcode method in S&F Pro with Avada 5, as in this thread:

    https://support.searchandfilter.com/forums/topic/shortcode-method-with-avada/

    I think Theme Fusion have made significant changes/improvements to Avada, and these may well have made it more difficult to use the other Display methods. The issue for us is to what extent any theme follows the WordPress Codex in their templating system (with regard to the wp_query and loop). Frameworks like Avada make significant modifications and changes compared to standard theme templates in order to offer very sophisticated options, which is why they are so popular, but at the same time said changes have the potential to conflict with our plugin in certain display modes.

    Anonymous
    #90510

    Hopefully, there is an update to this for Avada 5.0.

    I’ve just updated a large site to find this not working. I’ve been trying all display methods but nothing is playing well with the new Avada 5.0

    Design & Code – would this be on the agenda to look at as Avada is a common theme?

    Thanks,
    Luke

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