Support » Themes and Templates » Making a customised front page using categories

  • Here’s the deal:

    I’d like a front page where I’ve got two or three columns that each contain posts from a specific category. I’d like to have the first post in each column/category as a title and excerpt, and the following (5-10, I guess) as just the titles/links. This isn’t exactly what WordPress was built for, but is it still easily done? It’s basically a mini-version of the categories archive displayed one the front page, but I guess it involved a bit of tweaking. How would I go about doing this?

    Thanks a million in advance to anyone who will bother to help me out with this.

    I’ve browsed around to see if a solution to this has already been posted, but I couldn’t find anything comprehensive enough. I know a bit about how WordPress works, but not quite enough. I’ve been looking into using Drupal or Joomla or something similar, but I’m thinking that’s overkill.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I believe you want to restrict the loop. Keep in mind the “!” before a function logically means “not” or “not this”. Here’s another set of references. Follow the links on those pages, I think it’s all there.

    Ah, of course, I didn’t think of that. Thanks. I used filosofo’s function, which worked brilliantly, but I don’t know how I can modify it to make it possible to use it several times on the same page.

    Also, is there an easy way of displaying the latest posts from a certain category excluding the most recent one? (as I described above)

    It occurred to me that what you need is a mini-loop within the loop. My thought was that if you used another “for” loop, and incremented a variable, you could assign the last post a specific variable (perhaps 0), and not have any printing functions in that mini-loop. All other numbered variables would print. I’m not certain php supports for-next with variable creation, or not. (another thing to search for!)

    Then, it occurred to me to search for whether anyone had done that already, and with the proper keywords, I found this. It seems the “offset” thing (whatever it’s called) might be adaptable.

    The Template Tags page, referenced on the above page, appears to have what you’re looking for.

    Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making a customised front page using categories’ is closed to new replies.