WordPress.org

Ready to get started?Download WordPress

Forums

Programatic Switching with Child Themes (4 posts)

  1. GreekGeek123
    Member
    Posted 2 years ago #

    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!

  2. GreekGeek123
    Member
    Posted 2 years ago #

    [redundant comment deleted]

  3. smedsrud
    Member
    Posted 2 years ago #

    Im also testing this mothod - with blank index page.

  4. GreekGeek123
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic