Title: Separate boxes for excerpts?
Last modified: August 19, 2016

---

# Separate boxes for excerpts?

 *  Resolved [philfresco](https://wordpress.org/support/users/philfresco/)
 * (@philfresco)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/)
 * I’m sure this question would have been posted somewhere before, but I can’t quite
   name what I’m trying to do in a way that would be suitable for searching the 
   forums…apologies if this is a repeat question. I imagine this is simple to answer
   anyway:
 * I have a very simple theme at the moment, and on my homepage I have a container
   listing all the excerpts of the most recent posts in chronological order, as 
   most websites do. However, instead of having all the posts in one container, 
   I would like for each post to be broken up into separate boxes.
 * Here is an example of what I mean – [http://wordpress.org/extend/themes/ahimsa](http://wordpress.org/extend/themes/ahimsa)–
   on the Ahimsa theme, each post on the homepage is in it’s own section/box. How
   do I do that?
 * Thanks, Phil.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169469)
 * Site url?
 *  Thread Starter [philfresco](https://wordpress.org/support/users/philfresco/)
 * (@philfresco)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169477)
 * Sorry, but I’ve not got the site up at the moment. I know you could really do
   with seeing what you have to work with, which I why I know you may not be able
   to answer the question. If you could guess and give me anything to try, it would
   be greatly appreciated.
 * Thanks, Phil.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169487)
 * Try using something like:
 *     ```
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <div <?php post_class('postbox');?>>
       [...]
       </div>
       <?php endwhile; ?>
       ```
   
 * That should provide you with a class called “postbox” that you can then style
   via CSS.
 *  Thread Starter [philfresco](https://wordpress.org/support/users/philfresco/)
 * (@philfresco)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169552)
 * Looking at my code, I actually do have basically the same code that you gave 
   me above. I am able to style the “postbox” via CSS, but I can’t seem to style
   it so that there’s a gap in-between the individual posts. I just need to have
   a 10px gap in-between each post, where the background of the page shows through.
   At the moment, I have one central div box with the loop in it, so all of the 
   posts are displayed in one styled box in a list. However, I would like each post
   to be separated up into their own boxes, kind of like a divider; so the desired
   effect is that there’s a box with a border on it with the first post, then a 
   10px gap, then another box with a border on it with the second post in it, then
   another 10px gap, then so on. I tried adding a 10px margin to the “postbox”, 
   however it only made a white space in-between the posts, and didn’t spilt the
   box up (as I thought it would do). I just can’t seem to think of a way to do 
   it!
 * Any more ideas? Thanks, Phil.
 *  [Gisha James](https://wordpress.org/support/users/gjames/)
 * (@gjames)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169567)
 * Check whether this is what you are looking for
 * [Adding separate boxes for posts](http://worth2read.org/blog/2009/08/08/adding-separate-boxes-for-wordpress-excerpts/)
 *  Thread Starter [philfresco](https://wordpress.org/support/users/philfresco/)
 * (@philfresco)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169575)
 * Thanks for the link GJames, it did the trick! This is exactly what I was trying
   to search for, but it just didn’t show up in search engines!
 * And also thank you esmi for helping.
 * Thanks, Phil.

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

The topic ‘Separate boxes for excerpts?’ is closed to new replies.

## Tags

 * [boxes](https://wordpress.org/support/topic-tag/boxes/)
 * [excerpts](https://wordpress.org/support/topic-tag/excerpts/)
 * [for?](https://wordpress.org/support/topic-tag/for/)
 * [separate](https://wordpress.org/support/topic-tag/separate/)

 * 6 replies
 * 3 participants
 * Last reply from: [philfresco](https://wordpress.org/support/users/philfresco/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/separate-boxes-for-excerpts/#post-1169575)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
