Hi everybody,
can someone help me with a quick PHP argument?
I've looked at Customizing themes for node types, terms, sections, paths, and front page but I can't really make head or tail of it.
In short, I need this translated to PHP:
If path is 'apples', 'pears' or 'bananas',
then don't print <h1 class="main-title"><?php print $title; ?></h1>,
else <h1 class="main-title"><?php print $title; ?></h1>
or if that isn't doable, something like this:
If path is 'apples', 'pears' or 'bananas',
then <h1 class="hide"><?php print $title; ?></h1>,
else <h1 class="main-title"><?php print $title; ?></h1>
and I can use CSS to hide the h1 title on the fruity paths.
A note: I'm using paths like "www.example.com/bananas or the unclean version if I can't get the clean to work, which I will try right now. I don't think that matters for the php though.
A second note: I've twiddled with that title before and need this incorporated into the page.tpl.php, so that the snippets can work after another or if you can put them together.
<?php if ($page == 0) :
if ( arg(0) == 'blog' ) { ?>
<h1 class="blog-title"><?php print $title; ?></h1>
<?php }
else { ?>
<h1 class="main-title"><?php print $title; ?></h1>
<?php } ?>
<?php endif; ?>
Hope somebody can take a few minutes to look at this!