[wp-hackers] site sections, distinct theme per section

Lynne Pope lynne.pope at gmail.com
Fri Jul 8 23:11:52 UTC 2011


To use multiple header.php files where you have created template pages for
your sections, see this:
http://codex.wordpress.org/Function_Reference/get_header

If your sections are set up as categories you can change the appearance &
layout with CSS (and, optionally, JavaScript). To ensure that only the
CSS/js you need for those sections is loaded use the following:

<?php if (is_category(category-1-ID)) { ?>
header.php content
<?php } elseif (is_category(category-2-ID)) { ?>
header.php content for category 2
<?php } else { ?>
Default header.php content for everything else
<?php } ?>

Also see http://codex.wordpress.org/Conditional_Tags#A_Category_Page

You can use the same conditionals within templates to alter the output or by
calling different templates when certain pages or categories are called.

There are several different ways to achieve what you want within one single
WP site but if you intend to make a lot of conditional calls, for example to
load different templates within your sections, WordPress will perform better
if you take the multisite subdirectory install route. Swapping out the CSS &
scripts etc in the header by using conditionals doesn't have any noticeable
impact on performance. However, if you use this PLUS loads of custom
templates it can make a noticeable difference.

Lynne


On Fri, Jul 8, 2011 at 8:54 PM, John Black <immanence7 at gmail.com> wrote:

> Thanks for that Lynne.
>
> 1. What kind of conditionals would I be looking for?
> 2. General comment thrown into the wilderness: It is obvious that very
> large organisations have different wings. Wordpress has made great leaps
> forward lately, in terms of adoption as a full blown CMS. This could be
> encouraged more if this kind of functionality (the ability to have sections,
> recalling different themes / aesthetics) were able to be built into a single
> install.
>
> I'll look into the multisite option.
>
> best,
> JB
>
> On 8 Jul 2011, at 10:30, Lynne Pope wrote:
>
> > It's possible to do this by using conditionals in the header.php to serve
> > different css and JavaScript files to different categories. This only
> works
> > if the underlying HTML structure is the same for each of your sections
> and
> > you are happy to have each section set up as a category. The only other
> way
> > to do this is by using a multisite install and setting each section up as
> > its own instance within subdomains.
> >
> > Lynne
> >
> > On Fri, Jul 8, 2011 at 5:29 PM, John Black <immanence7 at gmail.com> wrote:
> >
> >> I've searched for an answer and didn't find anything. Not even a premium
> >> plugin exists, to my knowledge.
> >>
> >> Is there any way to do the following:
> >>
> >> Have multiple sections within a single WordPress installation (or
> domain)
> >> that each call up a distinct theme?
> >>
> >> For example: Maybe I'd like to use one theme for the opening pages; use
> a
> >> second theme for a dedicated e-store; a third theme for a dedicated
> video
> >> store; or another theme for a ticket / help section.
> >>
> >> These are just examples.
> >>
> >> I know that much can be done with single post templates, but this is not
> >> what I'm talking about. I'd really like to be able to use more than one
> >> theme on my domain.
> >>
> >> (p.s., I know subdomains would be a way, possibly, of doing this. But it
> >> seems an awful hassle, to have several installations running, several
> >> databases, etc, and I'm sure there would be issues later, not least,
> >> perhaps, with SEO).
> >>
> >> ANY IDEAS??
> >>
> >>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list