function hook_custom_theme


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_custom_theme()
cle7 system.api.php hook_custom_theme()
elmsmedia7 system.api.php hook_custom_theme()
icor7 system.api.php hook_custom_theme()
meedjum_blog7 system.api.php hook_custom_theme()
mooc7 system.api.php hook_custom_theme()

Return the machine-readable name of the theme to use for the current page.

This hook can be used to dynamically set the theme for the current page request. It should be used by modules which need to override the theme based on dynamic conditions (for example, a module which allows the theme to be set based on the current user's role). The return value of this hook will be used on all pages except those which have a valid per-page or per-section theme set via a theme callback function in hook_menu(); the themes on those pages can only be overridden using hook_menu_alter().

Note that returning different themes for the same path may not work with page caching. This is most likely to be a problem if an anonymous user on a given path could have different themes returned under different conditions.

Since only one theme can be used at a time, the last (i.e., highest weighted) module which returns a valid theme name from this hook will prevail.

Return value

The machine-readable name of the theme that should be used for the current page request. The value returned from this function will only have an effect if it corresponds to a currently-active theme on the site. Do not return a value if you do not wish to set a custom theme.

Related topics

9 functions implement hook_custom_theme()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

admin_theme_custom_theme in sites/all/modules/ulmus/admin_theme/admin_theme.module
Implementation of hook_custom_theme().
cis_service_icor_custom_theme in sites/all/modules/elmsln_contrib/cis_connector/instance_data/cis_service_icor/cis_service_icor.module
Implements hook_custom_theme().
entity_iframe_custom_theme in sites/all/modules/elmsln_contrib/entity_iframe/entity_iframe.module
Implements hook_custom_theme().
entity_iframe_mode_custom_theme in sites/all/modules/elmsln_contrib/entity_iframe/modules/entity_iframe_mode/entity_iframe_mode.module
Implements hook_custom_theme().
menu_get_custom_theme in includes/
Gets the custom theme for the current page, if there is one.

... See full list

1 invocation of hook_custom_theme()
menu_get_custom_theme in includes/
Gets the custom theme for the current page, if there is one.


modules/system/system.api.php, line 2316
Hooks provided by Drupal core and the System module.


function hook_custom_theme() {
  // Allow the user to request a particular theme via a query parameter.
  if (isset($_GET['theme'])) {
    return $_GET['theme'];



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.