• I’m trying to have a different style sheet displayed with different session id’s. In other words if someone goes here: http://www.website.com they get the default one if they go here http://www.website.com/?id=10 they get another one. I’ve got it working except one you click on another page it breaks, the session isn’t stored. Here is the code I have so far:

    in the wp-config.php:

    session_start();

    in the header.php:

    $_SESSION['id'] = $_GET['id'];
    if ($_SESSION['id']=="10") { ?>
    <link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/themes/default/style1.css" type="text/css" media="screen" />
    <?php
    }
    else { ?>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <?php } ?>

    Any help would be great.

The topic ‘Different Style Sheet Based on Session’ is closed to new replies.