/ Published in: PHP

Easiest way to switch theme styles for WordPress demos.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//place in php tags above DOCTYPE declaration <?php //Set Default style $demo_style = "style"; //Retrieve Cookie (if exists) //Set Style $demo_style = $_COOKIE['your-theme-style']; } //Retrieve Style form URL //Set Style $demo_style = $_GET['style']; //Set cookie } ?> // Put stylesheet link in head <link href="<?php bloginfo('stylesheet_directory'); ?>/<?php echo $demo_style; ?>.css" rel="stylesheet" type="text/css" media="screen" /> //links in theme page http://www.yoursite.com/yourtheme/?style=style http://www.yoursite.com/yourtheme/?style=another_style http://www.yoursite.com/yourtheme/?style=yet_another_style
URL: http://www.mojo-themes.com/demo/stereotype-one-page-wordpress-theme/
Comments
