How to Remove Date From Posts
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 $icon开发者_JAVA技巧s[] = 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)): ?>
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.
精彩评论