Slim Mobile Theme Switcher

Descripción

Slim Mobile Theme Switcher is a developer-friendly, lightweight solution for sites that need a dedicated mobile experience without the overhead of a heavy mobile plugin. This plugin targets mobile handhelds, ensuring tablet users may still enjoy your full desktop-grade layout.

Key Features

  • True Mobile Detection: Uses refined regex to separate small-screen phones from tablets (iPads/Android tablets).
  • Manual Overrides: Allow users or testers to force a view using ?theme=handheld or ?theme=active.
  • Persistent Choice: Option to remember a user’s manual theme choice for 30 days via cookies.
  • No Bloat: Zero front-end CSS or JS added by the plugin itself.
  • Developer Friendly: Built by a developer for developers.

How It Works

The plugin uses a precise, two-step detection process to ensure the best user experience:
1. Exclude Tablets: High-resolution devices (iPads, Android tablets, Kindle Fire) are served the Desktop Theme to take advantage of their screen size.
2. Detect Phones: Handheld mobile devices (iPhone, Android Mobile) are served the Mobile Theme.
3. Manual Choice: If a user manually switches via URL, their choice is honored for 30 days via cookies.

Capturas de pantalla

  • The settings page where you can choose your mobile and desktop themes.

Instalación

  1. Upload the slim-mobile-theme-switcher folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to Settings > Mobile Theme Switcher to select your mobile and desktop themes.

FAQ

How do I add a “View Full Site” link?

You can add a link to your mobile theme’s footer: <a href="?theme=active">View Full Site</a>

What should I configure in my caching plugin?

For best results, exclude the theme query parameter from your cache. If your host supports it, enable “Vary by User-Agent” or “Mobile Caching”.

Why isn’t my theme switching?

The most common cause is Page Caching. If your host (like WP Engine or Kinsta) or a plugin (like WP Rocket) caches the desktop version of a page, it may serve that cached HTML to mobile users regardless of this plugin. Please ensure “Mobile Caching” or “User-Agent Vary” is enabled in your caching setup.

Does this work with tablets?

By default, tablets (iPads, etc.) are served the Desktop Theme. This is a deliberate design choice to ensure high-resolution tablet screens receive the most robust version of your site.

How do I link to the mobile version manually?

Simply add ?theme=handheld to any URL on your site. To go back to the default/desktop view, use ?theme=active.

Reseñas

No hay reseñas para este plugin.

Colaboradores & Desarrolladores

“Slim Mobile Theme Switcher” es software de código abierto. Las siguientes personas han contribuido a este plugin.

Colaboradores

Traduce “Slim Mobile Theme Switcher” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código, echa un vistazo al repositorio SVN, o suscríbete al registro de desarrollo por RSS .

Historial de cambios

1.0.0

  • Initial release.