Drupal 7 – Alter the site logo link in Omega theme

I was working on a Drupal 7 website with Omega theme and i want to customize the site logo link. This can be done by creating the <Omega subtheme>/process/process-region.inc.

<?php
function <theme>_alpha_process_region(&$vars) {
  if (in_array($vars['elements']['#region'], array('content', 'menu', 'branding'))) {
    switch ($vars['elements']['#region']) {
      case 'branding':
        $vars['linked_logo_img'] = $vars['logo'] ? l($vars['logo_img'], '<NEW HOME PATH>', array('attributes' => array('rel' => 'home', 'title' => check_plain($vars['site_name'])), 'html' => TRUE)) : '';
    }
  }
}


 

Update the <NEW HOME PATH> without any preceding /. For example, if you want to link the site logo to /home. just replace <NEW HOME PATH> by home.

Done =)

2 thoughts on “Drupal 7 – Alter the site logo link in Omega theme”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.