Viewing 2 replies - 1 through 2 (of 2 total)
  • details depend on your theme and on the locations where you want to remove the date: i.e. single posts? or archive? or index?

    possibility 1:
    if your theme uses body_class() and post_class() and has a specific css class for the post date, you can use css to hide the date;
    example from Twenty Eleven:
    .category-somecat .entry-meta .entry-date { display: none; }
    http://codex.wordpress.org/Function_Reference/body_class
    http://codex.wordpress.org/Function_Reference/post_class

    possibility 2:
    add a conditional statement around the post date output, in index.php, single.php, archive.php, category.php, …
    example:

    <?php if( !is_category(array('cat1','cat2')) && !( is_single() && in_category(array('cat1','cat2')) ) ) : ?>
    existing post date code here
    <?php endif; ?>

    http://codex.wordpress.org/Conditional_Tags

    possibility 3:
    create category templates for those two categories, starting with a copy of category.php or achive.php of your theme; then remove the post date code from the loop.
    http://codex.wordpress.org/Category_Templates

    Thread Starter ndrann

    (@ndrann)

    Hello Sir,

    I do use Alltuts theme and wish to remove post date from two of the specific categories and wish to retain dates on all other categories. Then what should I do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘To remove date from specific post category’ is closed to new replies.