Printable Version of Topic

Click here to view this topic in its original format

Forums _ Webmasters' Corner _ Visitors select layout.

Posted by: Geheroe Jun 8 2010, 09:41 PM

I'm using Zymic which allows use of PHP.

I'm currently about to create yet another (personal) website. I want there to be an option where visitors can choose a different layout for the site, and possibly the preference would be remembered for the next time they visited.

Does anyone know the code? Or have a link that could tell me how?

Posted by: Mikeplyts Jun 9 2010, 12:37 AM

I think you'd have to use Javascript for that. Maybe have the Javascript change the stylesheet URL to a different one when a user selects a certain theme and then set a cookie when they do, so if they refresh or go back or whatever, have the Javascript load the cookie which saved the stylesheet URL last selected.

I'm not sure about the code itself right now, because I got back from a bar and I'm awfully tired. Also, I think I'd rather use jQuery for this, if it's possible. Maybe I can post one tomorrow.

Posted by: kawohi Jul 30 2010, 09:05 PM

If you still in-need of this http://designm.ag/tutorials/jquery-display-switch/.

Posted by: ahmad Aug 1 2010, 11:51 PM

I don't know if that previous post by Mike helped but this might also:

http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-day-15/
http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-day-15-part-2/

It's two short screencast by Jeffrey Way that shows you how to do it using PHP in the first video and in the second video he shows you how to enhance that using jQuery.

Posted by: thomasallen Aug 3 2010, 08:39 AM

You may also visit this link http://codex.wordpress.org/FAQ_Layout_and_Design