I am using a lot of custom post types throught my site and don't want to show a "posted on" date on them.

I only want date to be shown for the post in "Featured" category.

I've made some changes in loop:

<?php twentyten_posted_on(); ?>


<?php if($category->name == 'Featured'){twentyten_posted_on();} ?>

Now the date is gone everywhere, including the posts within "Featured" category as well... What am I doing wrong?

  • Where do you set $category and what is set to? Please post your code in context.
    – s_ha_dum
    Commented Jul 29, 2013 at 1:29

1 Answer 1


I do not see why you want to do such a thing but it would be easier to proceed like that :

if( has_category('Featured') ) twentyten_posted_on();
  • Thank you, it worked. I only need to show dates in the blog section of the wordpress CMS, the rest of post used in place of static pages and don't need any dates on them.
    – Acidon
    Commented Jul 29, 2013 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.