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

John Black immanence7 at gmail.com
Mon Jul 11 07:21:59 UTC 2011


Thanks for this.

When it comes down to it, I really need to activate the entire theme, with the functionality it has. So it's more than appearances. This is the difficulty.

Having looked into this more, and having tried a multisite installation (and then having experienced the difficulty of cloning a multisite install, and even backing one up), I'm heading in a direction few would agree with: discreet installs in subdirectories.

Consequently, I have a new question: 

I now have four installs working together to constitute a site: 1) http://mydomain.com (an opening theme); 2) http://mydomain.com/main (the main site, based on a separate theme and a separate install); 3) http://mydomain.com/store (based on the same theme as /main but with a custom skin); and 4) http://mydomain.com/ads (based on the same theme as /main but with a custom skin).

I want to keep the last two installs (#3 and #4) because I want to keep the URLs tight (i.e., http://mydomain.com/store and not http://mydomain.com/main/store).

My question is: How can I integrate http://mydomain.com/main and http://mydomain.com/store so customers joining and logging in to /main are automatically linked to (and logged in to) /store and /ads?

All sites are run within one database, with different wp_ prefixes. I tried adding the following to the bottom of the wp-config.php file of the installs I want to link:

/** Unify Logins. */
define(CUSTOM_USER_TABLE,'wp5_users');
define(CUSTOM_USER_META_TABLE,'wp5_usermeta');

wp5_ prefix is the prefix of the install I want to take precedence.

(I picked up this tip here, by the way).

But when I log into wp5_ (install #2) and go to the admin of wp6_ (install #3) it asks me to login again. 

So: a) customers of wp5_ (install #2 or /main) would have to have a separate account on wp6_ (install #3 or /store) and wp7_ (install #4 or /ads). People would be logging in twice or more. I want to unify these.

Can I somehow bridge these installs?

An added complexity is that I want to use s2Member or something similar to manage membership of my site as a whole.

I also wanted users to be able to use their login details to access the site's forum (which so far is based on phpBB3; this plugin allows you to bridge Wordpress and phpBB3, but only by making all access to Wordpress be handled by phpBB3).

If anyone can help me navigate through this maze I would be eternally grateful!!

best,
JB

On 9 Jul 2011, at 01:11, Lynne Pope wrote:

> 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
>> 
> _______________________________________________
> 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