I have been working on wordpress for a while. I know that we can manage themes via the admin panel and the selected theme and its configuration details are stored in the database.
Is there any way I can set the theme via my wordpress code?
Have a look at the switch_theme
function on the Codex
Switches current theme to new template and stylesheet names. Accepts one argument: $stylesheet of the theme. ($stylesheet is the name of your folder slug. It's the same value that you'd use for a child theme, something like
twentythirteen
.) It also accepts an additional function signature of two arguments: $template then $stylesheet. This is for backwards compatibility.
<?php switch_theme( $stylesheet ) ?>