How to? Display category posts in 2 colums (3 posts)

  1. marksurf
    Posted 5 years ago #


    I have been searching around for a piece of code to display my category posts in 2 columns. Is this possible?

    So the result of archive.php would be:

    post 1 | post 2
    post 3 | post 4
    post 5 | post 6

    this is my current page

    Thanks for the help

  2. marksurf
    Posted 5 years ago #

  3. gr1zzly
    Posted 5 years ago #

    How are you with CSS? In styles.css try:

    .post {
    border-left:1px solid #ddd;
    padding:0 12px;
    .post:nth-child(odd) {

    I haven't tested this but off the top of my head this should give you two posts side by side with a faint grey line in between them. The padding makes sure that there is a gap between the content of the post and the line, while the second rule prevents the left hand side posts from also having a left border.

    Of course you could add whatever styling you want with CSS, if you'd prefer not to have a vertical border between the posts etc.

    This is most likely the easiest way without customising a template file for this purpose. Hopefully it should at least get you somewhere near.

    If your not sure how to edit styles.css:
    You can access styles.css in the admin panel's theme editor, just select the file from the right hand list, scroll to the bottom of the file and paste the code there.

    Worst comes to worst and my code doesn't work simply edit the file again and delete what you just pasted!


Topic Closed

This topic has been closed to new replies.

About this Topic