2 smpdawg Apr 09, 2007 04:47

<?php
if( !empty( $cat ) )
{
echo '<p class="time">';
$Item->issue_date('d F y');
echo ' ';
$Item->categories();
echo '</p> ';
}
?>
You never know, it might work :roll:
¥
At Yabba
Yep, it works but I want it in reverse :)
I want the $Item->categories() to show on the home (index.php) page and not on Categorie pages....
My logic for this is that if you have selected a category from the menu, you don't need it's name repeated over and over while your in that category.
On the other hand, the index page could have 5 posts from 5 different categories so it's worth linking to it within each post.
Here's what I hacked together
Ok, if there is a cleaner way I'm all for it...
<?php
if( !empty( $cat ) )
{
echo '<p class="time">';
$Item->issue_date('d F y');
echo '</p> ';
} else {
echo '<p class="time">';
$Item->issue_date('d F y');
echo ' ';
$Item->categories();
echo '</p> ';
}
?>
Thanks for the help ¥åßßå and smpdawg
<?php
echo '<p class="time">';
$Item->issue_date('d F y');
if( empty( $cat ) )
{
echo ' ';
$Item->categories();
}
echo '</p> ';
?>
Oops, there was an extraneous ! in there :roll:
¥
Thanks Killer.
Check the value of $disp.
e.g.
If it doesn't work, make sure you declare it using global near the top of your template.