WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show latest posts in a grid with different sized squares (4 posts)

  1. Eckstein
    Member
    Posted 1 year ago #

    I'm trying to figure out how to show the first 6 posts from my site on my homepage using a grid with different sized boxes. You can see the shape of the grid here: http://www.theseattlevine.com.

    There is a large area to the left for the latest post, a smaller area in the 2nd column for the 2nd post, and then 4 smaller boxes for the next 4 below that.

    I can figure out how to show 6 posts in the same sized boxes using a custom query but I can't quite figure out how to style the image/excerpt/title of each post to be different based on which box it's in.

  2. georgsa
    Member
    Posted 1 year ago #

    how did you solve this ?

  3. Eckstein
    Member
    Posted 1 year ago #

    I used get_posts to display each square. Then, you can set an offset equal to the number of squares above it. So for the 2nd square, the offset would be 1. For the third, the offset would be 2, etc.

    Here is the docs on get_posts: http://codex.wordpress.org/Template_Tags/get_posts

  4. georgsa
    Member
    Posted 1 year ago #

    Thanks very much

Topic Closed

This topic has been closed to new replies.

About this Topic