0

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:

swapped
<?php twentyten_posted_on(); ?>

with

<?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 Jul 29 '13 at 1:29
0

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 Jul 29 '13 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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