Skip to content

Instantly share code, notes, and snippets.

@yannickoo
Created July 12, 2014 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yannickoo/9bc874916dd989fb2293 to your computer and use it in GitHub Desktop.
Save yannickoo/9bc874916dd989fb2293 to your computer and use it in GitHub Desktop.
Allows switching theme via $_GET parameter.
<?php
/**
* Implements hook_custom_theme().
*/
function mymodule_products_custom_theme() {
$themes = list_themes();
if (isset($_GET['theme']) && $_GET['theme'] && isset($themes[$_GET['theme']]) && $themes[$_GET['theme']]->status) {
return $_GET['theme'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment