CSS Style Switching (2 posts)

  1. Jen Baumann
    Posted 7 years ago #

    I apologize for starting a new thread, but I realized that where I posted before was marked [resolved]. I'm trying to use the A List Apart method of switching.

    I can't get this method to work to save my life. I've tried several different suggested methods of implementing this without success. In the process, I've now confused myself!

    I have:
    <form action="wp-content/themes/crisp/switcher.php" method="post">
    <select name="set">
    <option value="style"> » Spring</option>
    <option value="Pegasus" selected="selected"> » Pegasus</option>
    <input type="submit" value="Change Style">



    if (isset($_POST['set']))
    setcookie ('style', $_POST['set'], time()+31536000, '/', 'dreamwhisperdesigns.com', '0');
    header("location: " . $_SERVER['HTTP_REFERER']);


    <link rel="stylesheet" type="text/css" media="screen" title="Pegasus" href="<?php bloginfo('template_directory'); ?>/<?php echo (!$_COOKIE['style'])?'Pegasus':$_COOKIE['style'] ?>.css" />
    <link rel="stylesheet" type="text/css" media="screen" title="Spring" href="<?php bloginfo('template_directory'); ?>/style.css" />


    I've tried everything - full urls, different combinations, etc.
    <link rel="stylesheet" type="text/css" media="screen" title="Spring" href="<?php echo (!$_COOKIE['sitestyle'])?'style':$_COOKIE['sitestyle'] ?>.css" />
    What am I missing?

  2. Nessdufrat
    Posted 6 years ago #

    Up for this, I have the same problem...

Topic Closed

This topic has been closed to new replies.

About this Topic