Loading a custom theme for drupal 7


in order to change the default theme for drupal 7,

you have to implement hook_custom_theme in your own module :

 * Implement hook_custom_theme
function mymodule_custom_theme(){
  global $user;
  // charging bartik theme for webmaster
  if (in_array('webmaster', $user->roles)){
    return 'bartik';

in this example i have loaded bartik theme for the ‘webmaster’ role.

Welcome to my blog :) !!

first post will be about a simple presentation,

i’m a software engineer specialised in web development for two years now,

i live in Tunisia,

i’m trying to start a blog which will contain posts related to my professional domain,

hope that it will be useful for someone who’s starting off on the web 🙂