Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #391849

    Hi – is it possible to display the category of a post along with it’s title and date in the Latest News widget?

    So the widget would display:

    Post Title
    Post Category
    Post date & time

    for each post displayed.

    Is that possible? – Thanks.

    #392285

    Hey pozza!

    Open up /enfold/framework/php/class-framework-widgets.php and on line 532 you should see this.

    echo "<strong class='news-headline'>".get_the_title();
    

    Add this on the next line.

    $cats = get_the_category();
    foreach ( $cats as $cat ) {
    	echo '<br /><span class = "widget_latest_category">'.$cat->cat_name.'</span>';
    }
    

    And you can style it with this CSS.

    .widget_latest_category {  }
    

    Best regards,
    Elliott

    #392354

    Thank you!

    That’s perfect – cheers.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Enfold Latest News Widget – Display post category as well as title and date?’ is closed to new replies.