Theme Switcher v1.2.6 released

Allows users to easily switch themes (ideal for allowing light/dark mode).

Theme switcher functionality is made available to users via a widget; settings done via widget administration.

Settings available to display available themes as a list or select drop-down; widget admin allows themes with certain prefix to be excluded and/or to include only themes containing a certain word or part of a word.

As an alternative to using the widget, the function azc_ts_theme_switcher() can be called directly; add ‘dropdown’ as a parameter to have the select drop-down, instead of the list, of themes returned.

This plugin is multisite compatible; each site will place and configure the Theme Switcher widget.

:notebook_with_decorative_cover: Changelog

  • Update readme files.
  • Update language template.
  • Fix bug with azurecurve menu.

:arrow_down: Download

Download from Github to manually install; if you already have the plugin installed, an update will be available in the admin dashboard.

:man_juggling:: Support

If you have any problems to log or features to request, contact me via the Plugin Support Forum or you can log an issue via the Github repo.

:bulb: Issues/Ideas

I’m keen to resolve any issues and happy to consider functionality requests, so please get in touch if you want to report a problem or ask for new functionality.

Could you test this with a theme like mine that supplies custom widgets?
I think the core logic for calculating which widgets to show when switching themes drops custom widgets out, (unless your plugin fixes that somehow).

Put a few widgets, including the theme’s custom widget.
View the page,
switch themes,
switch back and the custom widget is likely in Inactive Widgets.

You’re correct that custom theme widgets are made inactive.

Widgets in the sidebar were preserved even when the second theme didn’t have the same sidebar. When I switched back to first theme those widgets were back.

I personally think this is a bug in core (and said so when this was last changed), but there are two scenarios to consider.

  1. switching themes is rare and should update the destination theme with the sidebar info from the source theme
  2. switching themes is common and each theme’s options should remain intact

While I’d like to see this fixed, I’m not sure of a good way, but because your plugin is definitely in the 2nd scenario, perhaps you could somehow short circuit that calculation of widgets and menus done when switching themes. Or maybe all it takes is a check for whether the widget belongs to the theme and if so, leave it alone.

I’ll make a note and do some investigation of what the options are.

I’ve generally only used this for flipping between child themes of the same theme (dark/light and so on).

This topic was automatically closed after 3 days. New replies are no longer allowed.