Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi theme wordpress plugin idea

I have an idea for running multiple wordpress themes at ounce. This might be a good thing to build into a wordpress plugin, if possible. And yes, I might undertake such a task if it isn't ridiculously hard.

(Also, if you are interested in teaming up with me, let me know (leave a comment), I am decent at javascript and php, but not to great, and would love some help!)

This is how I see it working: Current "set" theme is accessible here: "www.foo.com/" Second theme accessible here: "www.foo.com/index.php?set_theme=theme2&" Third theme accessible here: "www.foo.com/index.php?set_theme=THEME_NAME_HERE&" etc...

This could be used for javascript fall backs. For example, if you go to www.foo.com/?page_id=9 and have javascript turned on, you will hit a javascript redirect to "www.foo.com/index.php?set_theme=THEM_WITH_JAVASCRIPT&page_id=9".

This is how I imagine the plugin code looking/working:

   if(isset($_GET['set_theme'])){
       $loadme = cleaned($_GET['set_theme']);       
       if($loadme exists){
          loadtheme($loadme);
       } else {
          //go on as usual, as if this plugin doesnt exist
       }
    } else {
       //go on as usual, as if this plugin doesnt exist
    }

And of course, all the links would have to ad ?set_theme=FOOBAR&

So, my main questions are:

  1. How and where does Wordpress select the current theme?
  2. How/where would you ad this to modify internal links-
    if(isset($_GET['set_theme'])){ echo "?set_theme=" . $_GET['set_theme']; }
  3. Do you know of any good websites to point me in the right direction as to how to make WP plugins?
like image 396
Dave Avatar asked Jul 01 '26 23:07

Dave


1 Answers

You might like to look at the Theme Switcher plugin to see how that accomplishes this task - should give you some ideas.

like image 70
Paul Dixon Avatar answered Jul 04 '26 14:07

Paul Dixon