widgets don't show on non-enabled themes

When I switch to another theme using Theme Switcher, the sidebar widgets don't show anymore. These themes do have sidebar widgets widgets configured and enabled. I would like them to continue to appear when using Theme Switcher, otherwise the plugin doesn't help me. Thanks in advance!

  • Vinod Dalvi
    • WP Unicorn

    Hi @calenfretts,

    Thanks for posting on the forums.

    It is a known thing and the Theme Switcher plugin developer has replied about it as following.

    As for the Adv theme switcher not remembering the widget. No, I agree it does not. In fact it has no knowledge of other widgets. That is the job of WordPress. So if widgets are being moved around or moved you need to check the theme code. The Adv theme switcher is just a widget to show the available theme nothing more nothing less.

    You will find this reply on the following thread.

    https://premium.wpmudev.org/forums/topic/advanced-theme-switcher-does-not-remember-old-widget-settings#post-282855

    Please advise if you have more questions.

    Kind Regards,
    Vinod Dalvi

  • calenfretts
    • WPMU DEV Initiate

    Hi @Vinod Dalvi, thanks for your reply. That's disappointing that there's no way to show the widgets on the previewed themes as it's not really possible to fully convey what they would look like with (important) widgets (including the Theme Switcher widget itself). It's odd that they won't appear, too, because I can switch back and forth between the themes on the backend and it remembers the widgets across different themes.

    Is it possible that any further digging can be done into this, to see if it would be possible to make the widgets show, so that it would be useful to users like me? I'm trying to launch a new site soon and would really like to be able to include this feature.

  • Paul
    • The Green Incsub

    @calenfretts,

    I'm diving into it this evening. Technically the theme switcher plugin just calls a WordPress hook to tell it to load a specific theme instead of the one set as active on the Appearance > Themes page. The Theme Switcher really does not have much more control than that. It have no control really on adding widgets to a new theme. So this means you need to manually configure the theme and widgets on your own outside of the plugin.

    As you stated you can switch the theme in wp-admin and the widgets work fine. Not sure why they are then no loading correctly with the plugin. Will let you know as soon as I find something. Thanks.

  • Paul
    • The Green Incsub

    @calenfretts,

    I guess I've having trouble seeing the specific issues. I've setup a regular WordPress 3.8.1 site. On the site I have the three default WordPress themes. 2014, 2013 and 2012. I setup three widgets, Theme Switcher, Archive and Meta. I can set the active theme to be 2014 and then on the frontend using the Theme Switcher widget preview the others. In all the widgets display correctly. But I hear you say those are WordPress themes.

    Ok. I install a couple of other themes. Some with 2 sidebars some with threes. These are different. In each I go through the motion in wp-admin Appearance > Themes and Appearance > Widgets and setup the same widgets on each active theme. Now to the fronted I using the Theme Switcher widget to preview the themes. Works the same showing the same widgets.

    What am I missing? What themes are you using? What widgets are you using?

  • calenfretts
    • WPMU DEV Initiate

    @Paul, thanks for the update. It is odd that you are able to make it work. The themes I was using are Travelify, Attitude, Expound, Magazine Basic. The widgets are just text widgets and the Theme Switcher widget. Are you able to view the widgets in these themes? If so would it be possible for me to look at your demo site to see if I can figure out what the difference is?

  • Paul
    • The Green Incsub

    @calenfretts,

    I've loaded the three themes you mentioned. Strange part is now when I attempt to switch themes via the plugin the sidebars are not showing. Then tried reverting back to my previous configuration and not able to get the widgets to show. So not really sure what I was seeing last week.

    My setup. WP 3.8.1 non-Multisite with only the three theme installed and the theme switcher plugin active. I first activated each theme and setup three text widgets. And correct when I activate the Attitude theme in wp-admin I can see the widgets. But when I activate Expound in wp-admin then go to the front-end and use the theme switcher (I'm using a page shortcode) to switch to the Attitude theme the sidebars are not showing.

    Also strange when I'm in wp-admin and go to Appearance > Themes and preview a theme I also do not see the defined widgets. This is regardless of if the theme switcher plugin is active or not.

    Something has changed with the way WP loads widgets. Trying to dig into the core code to see if there is anything we can hook into.

  • Paul
    • The Green Incsub

    @calenfretts,

    Ok. Did some things I don't agree with but seems I did find a solution. You can see the working logic on my public test site.

    http://site2.media-tags.com/themes/

    On this site I'm running 6 themes:
    attitude, expound, travelify, twentyfourteen, twentythirteen, twentytwelve

    On all I've setup 2 text widgets. as part of the title I added the theme name.

    You can download the beta here and test on your own.

    https://dl.dropboxusercontent.com/u/2616987/WPMUDev/advanced-theme-switcher/beta/advanced-theme-switcher-1.0.9.4-Beta1.zip

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.