WordPress.org

Ready to get started?Download WordPress

Forums

Display posts on index.php as grid (4 posts)

  1. s872
    Member
    Posted 4 years ago #

    I'm wanting to know how to display posts on the index page as a grid. An example can be found on the tumblr theme 'Cargo' here:

    Tumblr Cargo Theme

    Any help much appreciated.

    Thanks,
    Simon.

  2. chicagowebdev
    Member
    Posted 4 years ago #

    Each post has to have an image, or a custom field that defines a thumbnail URL.

    I'd modify your CSS then and make each listing:

    display:block;
    float:left;
    margin-right:15px;

    For perfection, I'd add a counter inside the home.php loop so you know when you're on the last thumbnail and then modify that listings CSS by either adding a new class with PHP or modifying the markup directly with a style="margin-right:0;"

  3. s872
    Member
    Posted 4 years ago #

    Cheers... will try this out.

    Many thanks :-)

  4. alphacube
    Member
    Posted 4 years ago #

    Hi, talking about that cargo theme, I'm needing to display in the single page all published posts too. Something like making the single page to be a front page with the single post content displayed. Seems to be something about the query_posts stuff, but can't figure out how to do this.

Topic Closed

This topic has been closed to new replies.

About this Topic