WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've seen posts which probably answer this, but unfortunately the answers are all a bit technical without telling you where the code should go? At the moment I have my posts directed to a blog page. I separate my posts into three categories. What I would like is to have 3 columns for each category, with the ability to put an image and title above the start of each column, and a styled line between them. I understand that this involves Loops and editing the php files, but in other posts they don't say which php files or which css etc? Sorry for being stupid, but if possible a simple explanation would be great. I'm using the free pagelines theme, but on a localhost as just learning. Thanks very much!!

share|improve this question
You can do this with a few lines of CSS. – Brad Dalton Aug 10 '14 at 12:42

I am not familiar with the theme you're using, but that ought to be irrelevant anyhow.

Pages can be assigned template files, the php of which defines what and how content is displayed on said page.

You do not need to modify the page templates supplied with the theme, instead create your own in addition to the ones existing already (for reference read the linked codex page). Assign that to the page set as blog page.

Whether you decide to run three separate loops or fetch the posts in one query sorted by categories (and echo markup accordingly from within the loop) is pretty much up to you. As for how to go about said loop(s) see the codex on the WP_Query class and its usage.

Whether you enqueue a separate style sheet for it or edit the themes style.css file is again up to you.

Should the original theme author ship regular updates and you be planning on making use of these in the future, you might want to decide not to modify it at all, but to familiarize yourself with child themes instead.

share|improve this answer
Read the three supplied codex articles and give it a go. Should you encounter more specific problems on the way, feel free to supply some info on your progress, show your research efforts and ask a less generic question. Welcome to WPSE and good luck. – Johannes Pille Jun 9 '12 at 23:03
Thanks very much for these answers - I'll give the suggestions a go! – Matt Jun 10 '12 at 11:32
Hi again. Using those links I've managed to get something that sort of works: – Matt Jun 10 '12 at 13:55
Thanks again Johannes. Using code <?php query_posts('category_name=Cat1');?> /code etc I've been able to list the posts in columns. However, I'm having trouble getting the posts to only display a few hundred words and then "read more...". I'm also not too sure how to head each section of posts with the category title and an image, and separate each column with a line? Everything I try just gives a php error in the browser. – Matt Jun 10 '12 at 14:16
You can control the excerpt length using a filter and control which categories it applies to on specific pages using conditionals tags codex.wordpress.org/Function_Reference/the_excerpt – Brad Dalton Oct 27 '13 at 10:41

If you want to display post in three columns by category then you can choose my best answer this question, but it’s hard because I can’t give a “one solution fits all” answer. The code I provide here will have to be changed and adapted for your own theme. Everyone’s theme is slightly different, so all I can really do is give a generic response and hope that people reading this are able to change it to suit their own themes!

share|improve this answer
Which code? There is no code in your answer. – toscho Apr 14 '15 at 11:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.