Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The topic ‘Need to get the first category for each post in postslider.php’ is closed to new replies.
How can I get the first category of each post in this listing?
/enfold/config-templatebuilder/avia-shortcodes/postslider.php
$output .= “<div class=’slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}’>”;
got it…
$categories = get_the_category($the_id);
$cat_name = $categories[0]->cat_name;
$output .= “<div class=’slide-entry flex_column {$cat_name}{$style} {$post_class} {$grid} {$extraClass} {$thumb_class}’>”;