Pulling the post category from homepage grid

Posted in: Newsmag
Post count: 104

Hello,

I’m currently using a grid to layout the latest posts for a news website on the homepage. However I’ve been tasked with finding a way to add a breaking news banner to the thumbnail when a post is both in the latest news category AND in the breaking news category. I have the banner working great (see below), but I have no idea how to trigger the banner to show up..

Breaking News Banner On Homepage Grid

I’d really like to be able to trigger this banner if the 1st post is in the breaking news category. Any idea how I can tell if the 1st post is in the category?

Post count: 6535

Hi

To achieve the desired result you will need some customization in theme’s coder files. Basically you need to edit the module used to display that post and add a condition there: http://screencast.com/t/MllfhVoon

                if (in_category('cat1') and (in_category('cat2'))){
                    echo "breaking new banner goes here";
                }

Note that you may need additional css customization for banner’s layout.
Thanks!

Post count: 104

Perfect! Worked like a charm!

Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newsmag’ is closed to new topics and replies.