[wp-docs] Codex page needs to be rewritten
Frankie Roberto
frankie at frankieroberto.com
Mon Aug 17 14:52:32 UTC 2009
On Mon, Aug 17, 2009 at 3:00 PM, Jennifer Hodgdon <yahgrp at poplarware.com>wrote:
There's a bold-face paragraph at the top saying that page is not applicable
> as of WordPress 2.1, and it points to
> http://codex.wordpress.org/Settings_Reading_SubPanel
> which documents how to set your front page. What more do you think needs to
> be done?
I have to admit, this is one area of Wordpress which has always confused me.
Although that's more down to behaviour than the Codex documentation. I'll
try to explain.
With the default settings, the homepage displays the most recent n posts,
and uses the home.php template if available, or if not, the index.php
template. So far, so good.
Often, however, you'll want homepage to just be a static content page, and
have the blog as a separate section of the website. For this, you set the
front page to be one of your 'pages'. However, this causes the front page to
use the page.php template instead of the home.php template. This is fine if
you want the page to look the same as all the other static pages, but if you
want a different template for the homepage, you have to create a new
template, give it a name via a PHP comment, and then associate it with the
homepage via the 'Template' dropdown in the right hand nav. It would seem
to be much more logical to use automatically the home.php template (if it
exists) instead, but this doesn't happen.
The final circumstance is where you want to display the most recent n posts
on the front page, but you also want to have a few paragraphs of intro text
at the top. For this, the ideal would be to use a Wordpress page to hold the
intro text, and then display the n posts beneath (with the number based on
the setting in options-reading.php). However, because The Loop only displays
the page content OR the posts, the only way to achieve this (that I can
find) is to create a new named template, associate that with the page that's
being used as the front page, and then manually define a get_posts()
function call within the template to retrieve the most recent posts.
Does that sound like an accurate assessment of how the various settings
work, or have I missed something?
If I've got it right, this is definitely something that could be better
explained on the Codex, as it took me ages to get my head around this...
Frankie
--
Frankie Roberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-docs/attachments/20090817/61c6f5cf/attachment.htm>
More information about the wp-docs
mailing list