• Hi,

    I’ve got a space where can be displayed 4 or 5 posts next to each other, using a grid layout on 2 differents rows.
    If there is 4 posts to display, I would like 2 on each row, and if there is 5 posts, I would like a different layout. It can’t be done automatically with css, so I would like to set a css class on the parent div, something like container_4_posts or container_5_posts.

    So, does display post offer a way to do that ? The shortcode include a wrapper_class attribute, but is there a way to adapt the class accordingly to the number of displayed posts ?

    In the meantime, I’ll set the css class using javascript in order to count the posts.

    Thanks!

    • This topic was modified 3 years, 1 month ago by ottodix.
    • This topic was modified 3 years, 1 month ago by ottodix.
  • The topic ‘Adapt layout to number of displayed posts’ is closed to new replies.