WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My theme is in a folder called "mytheme" and the "Theme Name" in the style.css is "My Theme".

From that, I'm guessing that the option "template" in the options table is a reference to the folder, not the "Theme Name".

I'm asking because I want to be sure that the value I should pass to switch_theme() is a reference to the foldername mytheme, not the theme name "My Theme" ?

switch_theme('mytheme', 'style.css')
share|improve this question
up vote 1 down vote accepted

You'r right. The template-tag is based on your directory name. Same goes for a child-theme, which has a base theme as parent.

Check out the search_theme_directories() function for more information.

share|improve this answer
thanks, just wanted validation of my assumptions there. I think what was unclear to me is when the docs refer to "Theme Name", they usually are referring to the "folder name", not the "Theme Name" specified in style.css – Scott B Mar 31 '11 at 15:27
@ScottB You're welcome. ;) The docs are sometimes a bit confusing. I would recommend to read through the sourcecode. Just use a good IDE with declaration support, so you can jump around the defined funtions and see what they are doing in the background. – rofflox Mar 31 '11 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.