how to? if is_front = div class "front-content" else "content" I have a view that displays the latest articles on the front page and it links to the full article. I want to force a div class to the front page to 70% so I tried to add these lines to both block.tpl and page.tpl and it doesn't take into account the condition, it just sets to front-content on both displays. 

Here is the code:

&lt;?php if (!$is_front): ?&gt;
    &lt;div class="front-content"&gt;&lt;?php print render($page['content']); ?&gt;&lt;/div&gt;
    &lt;?php else: ?&gt;&lt;div class="content"&gt;&lt;?php print render($page['content']); ?&gt;&lt;/div&gt;
    &lt;?php endif; ?&gt;
Instead of adding a new class (and a div) you can simply target and override the layout for the front page in your style sheet with:

.front .content {
  width: 70%;
}


It's possibly you need to be more specific though, so you don't target all .content on the page. I don't know how you theme code looks, but it should be something like .front #main .content.

This assumes that your theme uses the default body classes in html.tpl.php for Drupal 7

&lt;body class="&lt;?php print $classes; ?&gt;" &lt;?php print $attributes;?&gt;&gt;


Or page.tpl.php for Drupal 6.

&lt;body class="&lt;?php print $body_classes; ?&gt;"&gt;


Cheers,