Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23247

    Hello,

    Is it possible to display search reasults in grid 2 columns ?

    Thank you

    #119068

    1) Insert following code into the quick css field:

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

    2) In search.php replace:

    if(!empty($_GET['s']))
    {
    echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>";

    /* Run the loop to output the posts.
    * If you want to overload this in a child theme then include a file
    * called loop-search.php and that will be used instead.
    */
    $more = 0;
    get_template_part( 'includes/loop', 'search' );

    }

    with:

    if(!empty($_GET['s']))
    {
    echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>";

    global $posts;
    $post_ids = array();
    foreach($posts as $post) $post_ids[] = $post->ID;

    $atts = array(
    'type' => 'grid',
    'items' => get_option('posts_per_page'),
    'columns' => 2,
    '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'>".$blog->html()."</div>";
    }

    This solution has some disadvantages (eg you won’t see the result counter, etc. on the left side) but on the other hand it would destroy the grid layout anyway…

    #119069

    Hi,

    Missing pagination !

    Thank you for your help

    #119070

    Yes, the problem is that the “use_main_query_pagination” parameter is not part of the theme code yet. The next update will include it. For now (if you want to use pagination) please stick with the default search.php code and use the code I posted above when we release the update (Enfold 1.5)

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

The topic ‘Search result layout’ is closed to new replies.