Possible Duplicate:
WordPress the_date() not working

I try to create a theme. In that theme I have create a custom post type and I quering the WordPress by using the wp_query to get the posts from that post type with the code that following :

$args = array(
    'post_type'         =>  'portfolio',
    'posts_per_page'    =>  18

$projects = new WP_Query($args);

<h3><?php the_title(); ?></h3>
<span><?php the_date(); ?></span>


the problem is, that while I get the title for all of my posts, I do not get the date for all of my posts. Some posts have the date, other they don't

Any idea for that issue ?


1 Answer 1


Use get_the_date() instead, here's note from the_date() codex page regarding the issue:

When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() or get_the_date() (since 3.0) with a date-specific format string.

Not the answer you're looking for? Browse other questions tagged or ask your own question.