I would like to display 1 category in the Byline and I need it to be the first category assigned to the post or alternatively exclude a specific category to be shown in the byline.
I use a 'Featured' Category that I assign to posts that I want to feature in Dynamic Content Gallery but I don't want the featured category to be displayed in the Byline. It should display the other Category (News, Post etc) that a post belongs to instead.
I have tried with this code in bfa_postinfo.php without luck:
PHP Code:
// 1st category, linked
if ( strpos($postinfo_string,'%category-linked%') !== FALSE ) {
$all_categories = get_the_category();
//Default to first category
$categoryIndex = 0;
//If first category is "Featured", select second category
if ($all_categories[$categoryIndex] == 10)
$categoryIndex = 1;
$category = $all_categories[$categoryIndex]->cat_name;
$category_linked = '<a href="' . get_category_link($all_categories[$categoryIndex]->cat_ID) .
'">' . $category . '</a>';
$postinfo = str_replace("%category-linked%", $category_linked, $postinfo);
}
Thanks
I use Atahualpa 3.4.6
Link to site: http://bit.ly/aTa8yB