Hi, I'm developing new website using drupal, and since I'm new to php, I'm having a problem which I believe is simple but can't find a solution. This is the code that gets site-name and places it between <h1></h1>: <?php if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></h1> I don't want to have site-name in h1 so I replaced that h1 with div: <?php if ($site_name) { ?><div id="site-name"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></div> And it works great. But, I want site-name to be in h1 on my frontpage, like it was on beginning. So, I would like site-name in h1 if it is frontpage, else I would like it in div. I have both codes but don't know how to put them in conditional statement properly.
assuming your frontpage has the uri "/" this will work: <? if($_SERVER[REQUEST_URI]=="/") { if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></h1> <? } else { if ($site_name) { ?><div id="site-name"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></div><? } ?> Code (markup):