Title: Category post grid
Last modified: August 19, 2016

---

# Category post grid

 *  Resolved [EntarteteMuzak](https://wordpress.org/support/users/entartetemuzak/)
 * (@entartetemuzak)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/category-post-grid/)
 * Hi,
 * I need to display posts from a category in a grid that looks like this:
 * POST1 | POST2 | POST3
    ____________________
 * POST4 | POST5 | POST6
    ____________________
 * POST7 | POST8 | POST9
    ____________________
 * How do I add a border after the first three posts?
    Sure I can do it with a background-
   image, but that is not flexible add not bulletproof.
 * How do I put a border on just POST2 in every row?
    I guess I can fix it with 
   a negative marginal in CSS, but that isn’t really that neat.
 * Thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [EntarteteMuzak](https://wordpress.org/support/users/entartetemuzak/)
 * (@entartetemuzak)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/category-post-grid/#post-1967639)
 * Solved the bottom border thing with this bit of code:
 *     ```
       <?php if (have_posts()) : ?>
       <?php $count = 0; ?>
       <?php while (have_posts()) : the_post(); ?>
       <?php $count++; ?>
       <?php if ($count%3== 0) : ?>
   
       // make with the usual article content
       //and do something under every third post
   
       <?php else : ?>
   
       // make with the usual article content
   
       <?php endif; ?>
       <?php endwhile; ?>
       <?php endif; ?>
       ```
   
 * Kudos to:
    [http://wordpress.org/support/topic/how-to-show-code-after-x-amount-of-posts](http://wordpress.org/support/topic/how-to-show-code-after-x-amount-of-posts)
 * Now it’s just the left and right borders….
 *  Thread Starter [EntarteteMuzak](https://wordpress.org/support/users/entartetemuzak/)
 * (@entartetemuzak)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/category-post-grid/#post-1967656)
 * Duh!
    Just add border-right css to post 1 and 2.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Category post grid’ is closed to new replies.

## Tags

 * [<hr>](https://wordpress.org/support/topic-tag/hr/)
 * [border](https://wordpress.org/support/topic-tag/border/)
 * [category](https://wordpress.org/support/topic-tag/category/)
 * [grid](https://wordpress.org/support/topic-tag/grid/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * 2 replies
 * 1 participant
 * Last reply from: [EntarteteMuzak](https://wordpress.org/support/users/entartetemuzak/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/category-post-grid/#post-1967656)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
