views:

41

answers:

1

I have the date in all of my posts and I'd like to remove them, both from the main page and from individual post pages. My site is SweatingTheBigStuff.com.

I think this is the code to look at. It's in the index.php file and there is something similar in the single.php file.

<?php ob_start(); ?>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?>
<?php if (!is_page()): ?>
<?php ob_start(); ?><?php _e('By', 'kubrick'); ?>: <title="<?php _e('By', 'kubrick'); ?>">
<?php the_author() ?></a>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
+1  A: 

WordPress uses a function called the_time() to display date and time information.
Turn this:

<?php if (!is_page()): ?>
    <?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
    <?php $icons[] = ob_get_clean(); ?>
<?php endif; ?>

Into this:

<?php if (!is_page()): ?>
    <?php ob_start(); ?><?php //the_time(__('F jS, Y', 'kubrick')) ?>
    <?php $icons[] = ob_get_clean(); ?>
<?php endif; ?>

Or just remove <?php //the_time(__('F jS, Y', 'kubrick')) ?> all together.

kevtrout
Turn what into what? I tried removing that line but I got errors.
Daniel
Looks like half my answer was hidden due to my misplacement of the code formatting. Sorry about that. It's fixed now and should make more sense. You need to comment out only the_time function, not the entire line, or else you will get errors. If you still get errors, post them so we can figure it out.
kevtrout
I was able to do it by removing everything in those <>. so the 2nd half of the line.
Daniel
Great! the '<?php' and '?>' are what differentiate php code from html and tell the server what language of code to expect and execute.
kevtrout