Get Publish Date Not Modified Date
-
How do I get the date the post was published? All the WordPress functions seem to only pull the post_modified date.
This is what I am doing:
$myposts = get_posts([ 'post_type' => 'fiveminutespodcast', 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' ]); foreach ( $myposts as $post ) : $mytitle = get_the_title($post); $url = get_permalink($post); $date_time = get_the_date('M j, Y'); echo "<a href='$url'>$mytitle</a> ($date_time)<br>"; endforeach;
But this keeps pulling up the post_modified date – or so it seems.
The page I need help with: [log in to see the link]
- The topic ‘Get Publish Date Not Modified Date’ is closed to new replies.