• Resolved mikecz

    (@mikecz)


    Hello.

    As you can see here, there is a few posts and every post should have a post date, categories, number of comments… in a following format: [date] in [categories] – [comments].

    The problem is, that there is some reason why wordpress does not generate it everywhere. Do you see? Somewhere the date is missing. Why? I don’t know.

    Please help.

    Theme Editor >> Archive (archive.php):

    <?php while (have_posts()) : the_post(); ?>
    					<li <?php echo $odd; ?> id="post-<?php the_ID(); ?>">
    
    						<div class="archive_title">
    							<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    						</div>
    
    						<div class="archive_postinfo">
    							<div class="date"><?php the_date('l jS F, Y') ?> in <?php the_category(', ') ?> - <?php comments_popup_link('No Comments', '1 comment', '% comments'); ?><?php edit_post_link('Edit post', ' | ', ''); ?></div>
    						</div>
    
    					</li>
    			<?php $odd = ( empty( $odd ) ) ? 'class="alt" ' : ''; ?>
    		<?php endwhile; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • MichaelH

    (@michaelh)

    A ‘warning’ in the the_date() article explains that you should use the template tag, the_time(), instead.

    Thread Starter mikecz

    (@mikecz)

    Thank you very much. Works perfectly and I’ll remember this.

    Why isn’t the_time() used everywhere instead of the_date()? Or whyever is there any function the_date(), when the_time works good always?

    MichaelH

    (@michaelh)

    Some people prefer that the date not repeat.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘A problem with date in category archive page’ is closed to new replies.