• I’m new to WordPress and am trying to figure out how to add this PHP switcher from A List Apart.

    My question is how do I add this snippet to the head tag for every page?

    <link rel="stylesheet" type="text/css"
    	media="screen" title="User
    Defined Style" href="<?php echo
    (!$sitestyle)?'defaultstyle':$sitestyle ?>.css" />
Viewing 4 replies - 1 through 4 (of 4 total)
  • Under your themes folder, there should be either a header.php or the main default file (I can’t recall the name of it at the moment). In that file, you’ll find the html “head” tag. I’d stick it in there.

    Thread Starter snocaps

    (@snocaps)

    Thanks William.

    There’s two header.php files I found.

    …/wp-content/themes/mytheme/header.php
    …/wp-includes/theme-compat/header.php

    Do they both have to be changed?

    Perhaps someone else could confirm William’s tip, before I go wrecking stuff.

    In /wp-content/themes/mytheme/header.php.

    Thread Starter snocaps

    (@snocaps)

    Thanks Joseph.

    Ended up with a “Document Moved” error, the article is 8 years old so I’m going to try a find another solution. Looks like there was a plugin for something like this but it’s deprecated now.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CSS style swticher script’ is closed to new replies.