Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #694706

    Hi i find the solution to display the search results in columns with this code:
    ’ve seen a topic where is asking this. This is the answer:

    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>”;
    }

    But how can i remove the meta data: categories, comments and date? The only thing that has to be displaid here, are the title with permalink and the featured image.

    • This topic was modified 7 years, 5 months ago by TanjaV.
    #694884

    Hi TanjaV,

    Could you post a link to the site in question so that we can take a closer look please?

    Regards,
    Rikard

    #695404

    The search is only activated on a conceptpage because the site is online and not in development mode. So i give you the info as private content.

    #695863

    Hi,

    Thanks for the login details, please try the following in Quick CSS under Enfold–>General Styling:

    .search-results .slide-meta {
    display:none; 
    }

    Best regards,
    Rikard

    #697722

    Thanks! That works great!

    • This reply was modified 7 years, 5 months ago by TanjaV.
    #698132

    Hey!

    Awesome! Let us know if you need anything else. :)

    Regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Search results in columns’ is closed to new replies.