Delete Date/Time In Wordpress

by 5 replies
7
Hey guys,

Was just wondering if anyone knew how to delete the time/date from all of your posts on wordpress by default?

Just looking at a php file makes me nervous so I thought I would ask here to find out exactly what I need to do.

Many thanks!
#programming #date or time #delete #wordpress
  • There are usually just 2 files you need to edit in your theme directory: wp-content/themes/Your Theme Name/

    index.php
    single.php

    (some themes have a separate widget page: home.php )

    Look for the following code in those files and delete it:

    HTML Code:
    <?php the_time('M.d, Y') ?>
    or

    HTML Code:
    <php the_date('M.d, Y') ?>
    depending on how your theme displays the time, or date...

    Jared
    • [ 1 ] Thanks
    • [1] reply
    • Hey Jared,

      I'm using "Flexibility" theme.

      In the index.php file there wasn't the exact code you posted, however, there is this;

      Code:
      <div class="postMeta"> <div class="postdate"><?php the_time('l, F jS, Y') ?> at 
      <?php the_time() ?>
      Is it safe to assume that I just delete any instance of;

      Code:
      <?php the_time() ?>
    • [ 1 ] Thanks
  • Yea Pat, you've got the idea...

    Just make sure you make a backup first...

    and the index.php file displays your main page content, whereas the single.php displays the post by itself if you click on the title, or the 'read more link', so make sure you edit your single.php page also.

    Jared

    P.S. We should probably get this post moved to either of these sub-forums:
    http://www.warriorforum.com/website-design/
    http://www.warriorforum.com/programming-talk/
    • [ 1 ] Thanks
    • [1] reply
    • Ok, great.

      It seems to be working so fingers crossed I didn't stuff anything up.

      Thanks, again!

Next Topics on Trending Feed