One of my challenges now, for a particularly difficult project, is to create a WordPress site, with a custom front-page. As it would be showing posts in different layouts, from different categories, I would need to create a custom WordPress loop. Looking at this, I realise I need to answer the following questions:

  1. How do I display a custom page as a WordPress Frontpage?
  2. How do I get multiple WordPress Loop?
  3. How do I select which posts to show and what not to show?

WordPress Custom Frontpage

The documentation is very helpful on defining a custom WordPress front-page. The WordPress Codex states how to do it Meanwhile, other blog-sites I have googled include “Static Frontpage – combined with Dynamic Content” over at MushuBlog. That one has an additional bonuses of telling you how to get posts from different categories and put them in your static frontpage. This leads to our second question – getting our own query loop, and having multiple loops.

Multiple WordPress Loops

The Loop is the mean by which you fetch posts from the WordPress backend database. It turns out that this is such a large issue that it has been fully documented with numerous examples on the WordPress Codex since I have last looked there.

WP Query, the Mysterious Object

WP Query is the mean which you use to retrieve posts. Whie this is also documented in the Codex (WP_Query reference), one thing that is of considerable mystery is what are the queries variables which you can pass in? We know that you can specify the categories, the number of posts, but what else? This piece of article on the codex seems to be comprehensive; worse to the worst, I will download an entire installation of WordPress and examine it with Eclipse PHP