[wp-hackers] Page Templates vs Category Templates

Chip Bennett chip at chipbennett.net
Thu Dec 2 03:58:06 UTC 2010

On Wed, Dec 1, 2010 at 9:42 PM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

> > And interestingly, cats are the 1st group where you need this
> > kind of flexibility, I think more than the pages...  Why should not I
> > have a no sidebar ( just content layout ) for some of my category
> > pages...  but you look at the themes world, majority provide a
> > no-sidebar layout only for the pages but cats are totally left alone.
> > I think this end-result may be trickling down from the out-of-the-box
> > WP UI which exposes Page layoutsbut not the cat layouts.
> If you need this functionality today if can be done but would have you
> implement a Page Template that lists your categories and then you create a
> Page for this and renamed your category slug something obscure.  You may
> also need to write a bit of PHP to hide tell WordPress your category URL is
> the URL of the page.
> Again, it's just not part of WordPress today.  But it is doable.

Unless I'm just completely misunderstanding what you're saying, why would
you need to do all of that?

If you know that you will want your category "Foobar"  to display full-width
with no sidebars, you merely need to add a "category-foobar.php" template
file, in which you remove the sidebars (and add appropriate CSS definitions
via the body.category-foobar class), and your "Foobar" category posts will
now display as desired.


More information about the wp-hackers mailing list