Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#14580 closed defect (bug) (worksforme)

<?php the_date();?> not working on scheduled posts?

Reported by: christopherross's profile christopherross Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: the_date
Focuses: Cc:

Description

I have a blog that displays the date for posts using <?php the_date();?> and it works great except when using it for posts which activated using the scheduled posts function, in which case it returns nothing.

Change History (4)

#1 @christopherross
14 years ago

Using get_the_date('l, F j'); does return the date.

#2 @ericmann
14 years ago

Can you provide some context? Where within your template are you using the_date()? What version of WordPress does this apply to?

I know I've been running WP 3.0.1 since it released, and the_date() seems to work fine on scheduled posts ... I don't want to go so far as to say it's a unique issue to your site, so I'd like some more information so I can try to reproduce the error before making any kind of diagnosis ...

#3 @Viper007Bond
14 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Are you aware that the_date() is specifically designed to not always output a value? Take a look at the documentation for the function:

http://codex.wordpress.org/Function_Reference/the_date

Unlike the_date(), get_the_date() will always return a value.

I'm going to mark this as worksforme as this is a common mistake. Please reopen if you are sure you are using the function correctly.

#4 @nacin
14 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.