I trying to modify a code.. help please
-
hi team, well i have a problem, I not have much experience in php and I need change a code, i need change this code
1)
$postheader .= ‘<span class=”entry-meta”><span class=”entry-comments”>’ . get_comments_number() . ‘</span>’;
for this code
2)
<span class=”entry-meta”><span class=”entry-subcat”>
<?php
$cats = get_the_category();
if (count($cats) > 1) {
echo $cats[1]->cat_name;
} else {
echo $cats[0]->cat_name;
}
?>I tried to change it but I get an error, i tried to change it for this code
3)
$postheader .= ‘<span class=”entry-meta”><span class=”entry-subcat”>’ . $cats = get_the_category(); if (count($cats) > 1) { echo $cats[1]->cat_name; } else { echo $cats[0]->cat_name; };
can someone help me please.!!
- The topic ‘I trying to modify a code.. help please’ is closed to new replies.