WordPress.org

Forums

Display two columns, remove blank space (5 posts)

  1. makta112
    Member
    Posted 8 months ago #

    Hi.

    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?

    Thanks!

  2. makta112
    Member
    Posted 8 months 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
    Forum moderator
    Posted 8 months 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
    Member
    Posted 8 months 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
    Member
    Posted 8 months 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');?>

Reply

You must log in to post.

About this Topic