[wp-hackers] Newbie here - Stopping posts appearing on the frontpage

jill jill at pericat.ca
Mon Jun 28 04:51:54 UTC 2004


Philip Taron wrote:

>An alternative, provided you only want one category
>of blog posts to appear on the front page, is to use http.conf
>or a .htaccess file to set the DirectoryIndex for the main page
>of the blog to index.php?cat=<some number>.  For my purposes,
>using WP as a CMS, I only want news to appear on the front page;
>that, for me, is category #5, so DirectoryIndex index.php?cat=5 ...

That's bloody fantastic, and very useful. It would never have occured to me to use .htaccess
to choke down the number of display-able posts.

Instead, for my photolog, I made a plugin (rightcat.php) that evaluates the available posts
and allows through only those whose category settings include the one specified. It's
available here:

<http://pericat.ca/downloads/rightcat.tar.gz>

For a given purpose, this approach may be more suitable, or not. On the plus side, it affects
only the weblog, where the scope of an .htaccess is at the least the entire directory's. On the
not-so-plus side, its evaluation is limited to a single category. Again, on the not-so-plus side,
if one is defining acceptable posts based on criteria other than category, it's completely
useless.

I've shoved in a readme that details how I'm using it. It solved my problem, so it makes me
happy. It may or may not do the same for others.

pericat
-- 
<http://pericat.ca/>



More information about the hackers mailing list