Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1340152

    Hi there,
    I have implemented a search page with a grid layout as per: https://kriesi.at/support/topic/search-results-page-grid-layout/#post-917717 . It previously worked on Enfold 4.8.6.1 for example, but after upgrading to 4.8.9 / 4.8.9.1,

    I have tested on several sites, when I downgrade to 4.8.6.1, it works perfectly. But after updating to 4.8.9.1, below is the error I receive:

    Fatal error: Uncaught Error: Call to a member function get_default_sc_args() on null in /home/babbomco/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/base-classes/class-sub-item-query-base.php:84 Stack trace: #0 /home/babbomco/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-product-slider.php(40): aviaBuilder\base\aviaSubItemQueryBase->__construct(Array, NULL, Array) #1 /home/babbomco/public_html/wp-content/themes/enfold-child/search.php(69): avia_product_slider->__construct(Array) #2 /home/babbomco/public_html/wp-includes/template-loader.php(106): include(‘/home/babbomco/…’) #3 /home/babbomco/public_html/wp-blog-header.php(19): require_once(‘/home/babbomco/…’) #4 /home/babbomco/public_html/index.php(17): require(‘/home/babbomco/…’) #5 {main} thrown in /home/babbomco/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/base-classes/class-sub-item-query-base.php on line 84

    Please assist on how to fix this.

    • This topic was modified 2 years, 9 months ago by Rustum.
    #1340195

    Hi Rustum,

    Can you give us admin access (just change the password after fixing it) and also FTP access? so we can try to debug and troubleshoot the issue.
    Just post the credentials in private content.

    Best regards,
    Nikko

    #1340295

    Hi Nikko,

    Please find the credentials as requested.

    #1340465

    Hi Rustum,

    Thanks for giving us both admin and FTP access.
    It seems the issue is in your child theme’s search.php file, you can verify this if you rename or change the file extension (so it won’t be read) you’ll see the search working properly.
    Hope this helps.

    Regards,
    Nikko

    Best regards,
    Nikko

    #1340485

    Hi Nikko,

    Yes, I am aware of that. My search.php file in my child theme contains a grid layout as per: https://kriesi.at/support/topic/search-results-page-grid-layout/#post-917717.

    It is not a typical search. It uses new avia_product_slider($atts); as per the above link, that’s the only customization done there. So this is where the main issue comes from.

    As per my previous post, the search.php file in my child theme with new avia_product_slider($atts); works perfectly on previous versions of Enfold, just not with the latest version. All I am trying to do is replace the default search results with a grid layout.

    Please assist.

    #1341067

    Hi Rustum,

    I see, I have replaced this code in your search.php file:

    global $posts;
    $post_ids = array();
    foreach($posts as $post) $post_ids[] = $post->ID;
    
    if(!empty($post_ids))
    {
        $atts   = array(
            'type' => 'grid',
            'items' => get_option('posts_per_page'),
            'columns' => 3,
            'class' => 'avia-builder-el-no-sibling',
            'paginate' => 'yes',
            'use_main_query_pagination' => 'yes',
            'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
        );
    
        $blog = new avia_product_slider($atts);
        // $blog->query_entries();
        echo "<div class='entry-content-wrapper'>".$blog->html()."</div>";
    }

    with:

    global $posts;
    
    $post_ids = array();
    foreach($posts as $post) {
        $post_ids[] = $post->ID;
    }
    
    if(!empty($post_ids))
    {
        $atts   = array(
            'type' => 'grid',
            'items' => get_option('posts_per_page'),
            'columns' => 3,
            'class' => 'avia-builder-el-no-sibling',
            'paginate' => 'yes',
            'use_main_query_pagination' => 'yes',
            'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
        );
    
        $blog = new avia_post_slider($atts);
        $blog->query_entries();
        echo "<div class='entry-content-wrapper'>".$blog->html()."</div>";
    }

    and added this CSS code in Enfold > General Styling > Quick CSS:

    .template-search .post-entry {
      clear: none;
    }

    Please review your site.

    Best regards,
    Nikko

    #1341231

    Hi Nikko,

    I have reviewed the site and the grid search now work perfectly.

    Thanks once again.

    #1341258

    Hi Rustum,

    We’re glad that we could help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Search Results Page – Grid Layout not working after updating enfold’ is closed to new replies.