Getting a specific value from form api in theme-settings.php In my custom theme I am developing, I have a form API setting in theme-settings.php that lets a user choose one of two options with a select menu as such:

 $form['txtr_settings']['general_settings']['choose_slideshow'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('Choose a slideshow'),
        '#default_value' =&gt; theme_get_setting('choose_slideshow'),
        '#options' =&gt; array(
            'basic' =&gt; t('Basic'),
            'fancy' =&gt; t('Fancy'),
        ),
    );


Then in my theme's page.tpl.php I want the value the user has selected to be part of an if else statement. 

Right now I have this code which does not seem to work:

&lt;?php if (theme_get_setting('choose_slideshow') == 'basic')
            include(dirname(__FILE__) . "/slideshow_alpha.inc");
        else
            include(dirname(__FILE__) . "/slideshow_beta.inc");
  ?&gt;


I know if I have a simple single checkbox (checked = yes or '1' I can do something like this:

&lt;?php if (theme_get_setting('choose_slideshow') == 1)


... but in this case I really want to show the user both options and have them choose one or the other in the select menu.  

If I use either option on it's own without the if / else, each works fine so I think it's a question of my theme_get_setting value. I am not really sure if this is a Drupal question or a PHP question that I should ask over on Stack Exchange.
The way to really do this was to create variables in template.php using a preprocess function and take some of the logic out of page.tpl.php and to instead use the actual variables created. Based on this, my updated code that's working is:

template.php

function my_theme_preprocess_page(&amp;$variables) {
 // create variables for each slideshow
  $variables['slideshow_alpha'] = (theme_get_setting('choose_slideshow') == 'alpha');
  $variables['slideshow_beta'] = (theme_get_setting('choose_slideshow') == 'beta');
}


... and then in page.tpl.php

 &lt;?php if ($slideshow_alpha): ?&gt;
    &lt;?php require_once dirname(__FILE__) . '/slideshow_alpha.inc'; ?&gt;
  &lt;?php else: ?&gt;
    &lt;?php require_once dirname(__FILE__) . '/slideshow_beta.inc'; ?&gt;
  &lt;?php endif; ?&gt;


It's important to note that what helped me figure much of the code updates out were running it through PAReview.sh. However, I did not want to set up the module and there is an online version which works great but your code needs to be in a git repo on drupal.org so you would have to set up a simple sandbox project to test your code. The online version is on ventral.org and it's what drupal.org uses to review projects. The new updated code also does not throw any errors with the code sniffer an the old code did.