WordPress.org

Support

Support » Plugins and Hacks » Hacks » Programatic Switching with Child Themes

Programatic Switching with Child Themes

  • switching themes on the fly using the following approach

    add_filter(‘template’, $templatename);
    add_filter(‘stylesheet’, $templatename);

    as a plugin (when done within functions.php, oh boy, the header.php wasn’t switching and it was a mess.. any thoughts on this also appreciated).

    When done with “full bodied” themes, works great. When I try to switch to a child theme, it blows up (blank browser page). The child theme works just fine when activated from the dashboard directly. The child theme, at this stage, is only a style.css that imports the parent’s css.

    Any thoughts on where this is going wrong or on a work around? TIA!

Viewing 3 replies - 1 through 3 (of 3 total)
  • [redundant comment deleted]

    Im also testing this mothod – with blank index page.

    Not sure this method will work, the internal WP load order is all wrong I think for this method. Either use one of the plugins or code your own to switch between top level themes. (would have been nice though!). That’s what I did. Not the ideal solution I wanted, but faster to make happen.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Programatic Switching with Child Themes’ is closed to new replies.