WordPress.org

Support

Support » Themes and Templates » remove date/time stamp for some posts but not others

remove date/time stamp for some posts but not others

Viewing 1 replies (of 1 total)
  • Hi,
    in similar situation (removing comments from one specific category), I have done like this in the post loop:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="topPost">
    <p class="topAuthor"><?php the_author_posts_link(); ?></p>
      <h2 class="topTitle"><?php the_title(); ?></h2>
      <p class="topMeta"><?php the_time('j F Y') ?> | <?php the_category(', '); ?> </p>
      <div class="topContent"><?php the_content(' More...'); ?></div>
        <p><?php the_tags('Tags: ', ', ', ''); ?></p>
     </div><!-- Closes topPost -->
    
    <?php
     if ( in_category(10) ) {
     continue;
     } else {
     include(TEMPLATEPATH . '/showcomments.php');
     }
     ?>
    
    <?php endwhile; ?>
    
    <?php else : ?>

    You could do something like this. Meaning that you save file (in your theme folder) called showdate.php or something where you put the date tag. And then you could put the if-else-condition above in the place where you have date tag now. My php skills are actually lousy but this is something which I found somewhere and works for me (possibly someone else has more elegant solution! :))

Viewing 1 replies (of 1 total)
  • The topic ‘remove date/time stamp for some posts but not others’ is closed to new replies.
Skip to toolbar