Title: Theme Switcher header issue
Last modified: August 18, 2016

---

# Theme Switcher header issue

 *  [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/)
 * I’ve tried several ways of using the theme switcher, but I keep getting the same
   error.
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/.milkyheater/poffutt/paulaoffutt.com/blog/index.php:3) in /home/.milkyheater/
   poffutt/paulaoffutt.com/blog/wp-content/plugins/theme-switcher.php on line 37
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/.milkyheater/poffutt/paulaoffutt.com/blog/index.php:3) in /home/.milkyheater/
   poffutt/paulaoffutt.com/blog/wp-content/plugins/theme-switcher.php on line 39
 * My default is Gila and I used my insomnia last night to get about seven themes
   ready to go with a click but I get errors.
 * I *think* the line# changes. I also tried the one that’s in french but got different
   php errors.
 * I just now reinstalled the plugin and put the code mentioned in the instructions
   in my sidebar. Got the above mentioned errors.
 * {{{
    Themes: ?php wp_theme_switcher(); ? }}} (took out the li part so it would
   show here with no problems)
 * Changed the code to be the one mentioned in another thread, the one that is default
   in a lot of themes lately, but got the same errors.
 * `<? php if (function_exists('wp_theme_switcher')) { ?>
    <?php _e('Themes'); ?
   > <?php wp_theme_switcher(); ?>
 * <? php } ?>
 * Most plugins I’ve gotten to work with little to no tweaking. But it seems all
   the really useful ones are the hardest. Damn that guy Murphy!

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

 *  [dawg](https://wordpress.org/support/users/dawg/)
 * (@dawg)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175774)
 * #1 you are using style switcher not theme switcher and you have tried to implement
   it in the header by doc type. Add the code you have above to the side bar
 * `<? php if (function_exists('wp_theme_switcher')) { ?>
    <?php _e('Themes'); ?
   > <?php wp_theme_switcher(); ?>
 * <? php } ?>
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175777)
 * It is in the sidebar.
 * I didn’t think I had uploaded the style switcher but I checked and it was there
   and on.
 * So, turned it off and now I get another error. By putting in line breaks, I have
   narrowed it down to the <? php } ?> (spaced added on purpose). The error is a
   
   Parse error: parse error, unexpected $ in (blah blah sidebar.php) line 87
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175780)
 * Me again. I uploaded the original side bar, after switching to Batavia. It has
   less bells and whistles than my Gila theme which is full of my crap.
 * I didn’t change the code any that was originally in the sidebar, which has the‘
   if function exists…’ part already in place.
 * Reloaded page. The parse error is gone but the original error is back.
 * It is in the sidebar and the style switcher is still off.
 * I guess I’ll force my few visitors to like whatever theme I’m in the mood for.
   heh heh
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175789)
 * [http://codex.wordpress.org/Answers-Trouble_Shooting#Headers_already_sent](http://codex.wordpress.org/Answers-Trouble_Shooting#Headers_already_sent)
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175797)
 * Okay, looked at the sidebar. If the <?php is the first, then it puts the themes
   outside the sidebar and on the screen all by themselves between the header and
   the body.
 * Error message now is directing back to theme-switcher.php lines 41 and 42. If
   I counted right, this is the offending section, starting with line 40:
 * select name=”themeswitcher” onchange=”location.href=\”.get_settings(‘siteurl’).’/
   index.php?wptheme=\’ + this.options[this.selectedIndex].value;”>’.”\n” ;
    foreach(
   $theme_names as $theme_name) {
 * this is beyond my grasp of understanding. I am a Southern Blond Female. 😀
 *  [goldie29](https://wordpress.org/support/users/goldie29/)
 * (@goldie29)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175802)
 * This error message may be caused by whitespace either before the beginning of
   the theme-switcher.php script, or after the end of the script (eg, either before
   the “<?” at the beginning, or after the “?>” at the end).
    Whitespace is any 
   text that is not visible, such as blank spaces, line feeds, carriage returns,
   tabs, or any other non-printable character. When you open theme-switcher.php 
   in notepad, make sure that the cursor cannot go beyond the “?>” at the end of
   the script. If it can, remove any extra space.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175804)
 * The problem isn’t in the sidebar, it’s in index.php on line 3.
 * “output started at /home/.milkyheater/poffutt/paulaoffutt.com/blog/index.php:
   3”
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175858)
 * I just checked the line 3 of the ‘main’ index.php (vs the index.php in Gila or
   any other theme) and it is the end of referrer-karma:
    check_referrer(); ?>
 * So I took out all the r-k lines, made sure that no blank spaces were before the
   first <? and…
 * theme switcher now works.
 * Any ideas why?
 *  [dawg](https://wordpress.org/support/users/dawg/)
 * (@dawg)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175867)
 * as being the first to reply, I want one of my themes added!!!!:)
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175872)
 * Which ones have you done?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175878)
 * Holyroller, add the RK line to the top of the index.php file in your WordPress
   directory, not the theme’s index.php
 *  Thread Starter [PaulaO](https://wordpress.org/support/users/holyroller/)
 * (@holyroller)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175931)
 * That’s where it was, macmanx.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-175939)
 * Interesting. That’s where mine is and I have no problems. But, I also don’t have
   the Theme Switcher enabled. That must be the key.
 *  [cenas_girl13](https://wordpress.org/support/users/cenas_girl13/)
 * (@cenas_girl13)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-176694)
 * Yes! I’ve just figured out my self, if you get a message like:
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/user/public_html/index.php:1) in /home/user/public_html/wordpress/wp-
   content/plugins/theme-switcher.php on line 37
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/user/public_html/index.php:1) in /home/user/public_html/wordpress/wp-
   content/plugins/theme-switcher.php on line 44
 * then, check to make sure there arent any blank spaces beetween your <? at the
   beginning and ?> at the end of your theme-switcher.php plug-in and your main 
   index.php file! =D

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

The topic ‘Theme Switcher header issue’ is closed to new replies.

 * 14 replies
 * 6 participants
 * Last reply from: [cenas_girl13](https://wordpress.org/support/users/cenas_girl13/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/theme-switcher-header-issue/#post-176694)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
