Title: Custom .php, set theme (not chosen)
Last modified: July 28, 2018

---

# Custom .php, set theme (not chosen)

 *  [haasorensen](https://wordpress.org/support/users/haasorensen/)
 * (@haasorensen)
 * [8 years ago](https://wordpress.org/support/topic/custom-php-set-theme-not-chosen/)
 * I’ve got some custom .php files which uses a specific theme for WordPress.
    But
   I need to switch main theme on my WordPress installation, but have some custom.
   php to still use the old theme.
 * Is it possible in my .php files to set manually set the theme, instead of having
   them choose the active theme for WordPress?

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

 *  Thread Starter [haasorensen](https://wordpress.org/support/users/haasorensen/)
 * (@haasorensen)
 * [8 years ago](https://wordpress.org/support/topic/custom-php-set-theme-not-chosen/#post-10534512)
 * So something like at the top of my custom .php files:
 *     ```
       <?php 
       /*
       Choose theme: My_old_theme
       */
       ?>
       ```
   
    -  This reply was modified 8 years ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This reply was modified 8 years ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [8 years ago](https://wordpress.org/support/topic/custom-php-set-theme-not-chosen/#post-10535649)
 * I think you should know better than others what you have done and how you can
   call the custom files with another theme. I suggest you next time write a simple
   plugin instead to write custom php files (look at [https://codex.wordpress.org/Writing_a_Plugin](https://codex.wordpress.org/Writing_a_Plugin)),
   and you will be able to switch to all themes you want.
    I also suggest you to
   never go out from the WordPress flow (maybe it’s not your case). From WordPress
   you can call a custom php file, but I would not create independent php files,
   because maybe now you don’t need the WordPress environment in that files, but
   you could in the future, and for safety reasons. Sorry for not really answer 
   to your question, but with the information we have I don’t know how to answer.

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

The topic ‘Custom .php, set theme (not chosen)’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/custom-php-set-theme-not-chosen/#post-10535649)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
