display/hide content only on the front page
description
This snippet allows you to hide/display content on the front pageof a Drupal site.
usage
- Using a text editor like notepad.exe, kate, TextWrangler or an equivalent, copy and paste the snippet into your page.tpl.php or your custom page-type.tpl.php file.
- Remove the exclamation point (!) to show on the front page and use it to show everywhere except the front page.
- Change the div class names or the link prefix text to suit.
The following example snippet will insert an image called blocks-top.jpg on all pages EXCEPT the front page.
<?php if (!$is_front): ?>
<div id="snapshot">
<img src="http://www.example.com/images/blocks-top.jpg" /><br />
</div>
<?php endif; ?> 