Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Can I make it so user can change theme colour scheme in 1 click at the front of site? (http://forum.bytesforall.com/showthread.php?t=14428)

mafgirl May 31, 2011 03:35 PM

Can I make it so user can change theme colour scheme in 1 click at the front of site?
 
This is probably the most random question you have ever heard as it certainly is mine ;)!

My client is asking me to create a website in blue and have a duplicate website exactly the same in green, linking to each other. I was wondering if I could create a link (in a widget or something) to the 'green' site and the 'blue' site, but linking it to the same url and only changing the colour scheme?

It sounds like it could be plausible, however I have no idea to do this so any help at all would be appreciated :) I have just started to study php, MySQL and JavaScript but am nowhere near good enough to figure this one out.. anyone have any ideas?

Thank you ever so much!!!

juggledad May 31, 2011 04:27 PM

Yes this is possible to do, but I would go back to the client and ask him how much he is willing to spend to do it and to maintain it in the future because it is not trivial.

you can have green.com point to one install of WP in a folder and
you can have red.com point to another folder with a WP install.

The key is to make the wp-config.php's in the wordpress roots exactly the same. now you have two installs pointing at the same database, but if you add a plugin, you must add it to both AT THE SAME TIME and before activating it. Same for wordpress upgrades - you'll need to do it manually on both sites

Next you will need to go to green,com and style it. then visit a page, grab the CSS that is created and save it. Then go to red.com and style it red., view the page and save the CSS.

you'll replace the existing style.css with the css you saved and then have to edit the code to remove the auto generated CSS. and every time there is a change to the theme, it will have to be done again, twice as much time for everything...actually more than double since you have to save the CSS each time...

but if the client is very rich....

mafgirl May 31, 2011 10:06 PM

Hi Juggledad! thanks for your reply...that sounds complicated..is it possible to have two wordpress installs on the same domain though?

I should have made myself clearer and said they are actually on the same domain. He currently has it like that on his current (non-wordpress) website www.corriganbentley.co.uk if you check it out he has a splash page and 'Sales & Technical Recruitment' and 'Lo-Carbon Products Recruitment' are duplicate pages, just Sales & Technical Recruitment is blue and Lo Carbon Products Recruitment is green. At the moment if one is changed, the other needs manually changing too.
He asked me to do a complete re-design on Wordpress, but keep the same style splash page with a green and blue 'site' on the same domain name.
So I was wondering if it is possible, rather than create two separate installs of wordpress, to have one install, and both pointing to the same single pages, but for the user to change the theme colour?
Ie the links on the splash page will trigger the theme colour, but point to the same page?

Maybe I am being to complicated about it and should just create the duplicate pages, but you are right, it will be more expensive for the client - and more work for me..

juggledad Jun 1, 2011 04:58 AM

so you want to have two pages, A and B. On page A you want two links, 1 and 2. Both links go to page B, but when you press link 1, page B is red and when you press link 2 page B is green.

Without digging into the code and testing the the link that was used, there is no way to do this. When you get to page B, it's page B. There is nothing to tell where it came from. Even if you create a custom menu with two links, B-RED and B-GREEN, when you press the link, when you get to page B both links B-RED and B-GREEN will have the class of 'current-menu-item' because they ARE the current menu item.

So your choice is to add code to see if you can add a class to teh body statement depending of teh menu item selected, or have two pages.

The idea of two 'sites' doesn't work unless you point to two different DB and then you still have double the maintenance.

lmilesw Jun 1, 2011 07:12 AM

The only way I can see to do what you want is to install two separate WP instances each in a different subfolder. The root would be your first page like you have at http://www.corriganbentley.co.uk/. So you would install one WP site at http://www.corriganbentley.co.uk/sales and one at http://www.corriganbentley.co.uk/green.

This is very similar to what you currently have. You will just have two complete websites to maintain which will be cumbersome when the info in both is supposed to be the same.

I would think creating page templates with different colored backgrounds or some other way to define them would be much easier but as we all know the client is king.

GarethP Jun 1, 2011 07:44 AM

Could you have 2 Atahualpa themes installed - i.e. ata-green and ata-blue and then use a plugin like this?

http://wordpress.org/extend/plugins/wp-theme-switcher/

It would mean 2 upgrades of the theme when necessary but that's quite minor...

juggledad Jun 1, 2011 07:55 AM

actually, looking at the existing site, it looks like they have three different sites - the home links are different, the about pages show different information.

You can install a separate version of WP in a subfolder and point it at a separate DB

mydomain.com -> database A
mydomain.com/green -> database G
mydomain.gom/red -> database R

mafgirl Jun 3, 2011 02:45 AM

wow thanks guys!

I didn't realize there were so many more replies until I just looked, must have forgotten to set up the email notification.
You have have some very good advice indeed, so I will get to work with these and let you know how I get on :)
Thank you SO much!!

Marjolijn


All times are GMT -6. The time now is 07:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.