Display two columns, remove blank space (5 posts)

  1. makta112
    Posted 1 year ago #


    I would like to display the posts on my site in two, side-by-side columns.

    This is my site.

    As you can see, the posts are displaying in two columns. But there are random blank spaces between some of the posts. How can I get rid of those?


  2. makta112
    Posted 1 year ago #

    I'm using this to display the content:

    <article id="post-<?php the_ID(); ?>" class="index-article<?php if ( !((1 + $wp_query->current_post) % 2) ) echo ' index-article-right' ?>">

  3. Andrew Nevins
    Forum moderator
    Posted 1 year ago #

    They're not random spaces, they're caused because some images are taller than others. So you can either resolve this through PHP or CSS by limiting the height.

  4. makta112
    Posted 1 year ago #

    Ok, how can I make the left column look like the one to the right? I want the images to keep their original heights.

  5. Nimesh
    Posted 1 year ago #

    go at media and select the image which you want to keep in their original height and edit it at that place you got the scal image tab where you hwill see the original image dimention.

    Another way if you have use the feature image, so in code you can write the code like <?php the_post_thumbnail('full');?>

Topic Closed

This topic has been closed to new replies.

About this Topic