Hide Date

Posted in: Newsmag
Post count: 25

Is it possible to hide the posts date on just one category but show on the rest?

  • This topic was modified 10 years by aspirin29.
Post count: 6535

Hi

Please provide your site url and more details about the category from where you want to hide the date so I can inspect and get back to you with a proper solution.

Thanks!

Post count: 25

The site is in “coming soon mode” right now.

But basically, see the demo sites article, http://demo.tagdiv.com/newsmag/td-post-the-best-independent-travel-magazines/

I would like to hide the meta: author, date, #views and #comments on the top of this post but only for the Fashion Week category. The Cosmopolitan and all the other categories I would like to show the meta Date.

Is this possible with a CCS Display “hide”? I just cant find how to do it.

Post count: 6535

Hi

You can’t target a post with css depending by its categories tags, it can be done only by the post id like in this example:

.postid-129 .td-post-date{
display: none;
}

This code will hide the post date for the post with id 129 but is not the best way to achieve that because if you have many posts from which you want to hide the date there will be lot of code.

This can also be done using a php condition in file corresponding with post template used: http://screencast.com/t/pNPy4Yfnur

if (!in_category('category-slug')){
echo $td_mod_single->get_date(false);
}

Note that this code will remove the post date from post html source, not only hit it.

Hope this help.
Thanks!

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