#14580 closed defect (bug) (worksforme)
<?php the_date();?> not working on scheduled posts?
Reported by: | 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)
#2
@
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
@
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.
Using get_the_date('l, F j'); does return the date.