get_the_date($recent[“ID”]) not working
-
Hello, so I’m trying to do a custom wp query to show the last post of a certain category(business) but somehow the date is the only value that I get wrong. Can you help me?
$business = array( 'category_name' => 'business', 'numberposts' => 1, 'order' => 'DESC', ); <ul class="fashion_catgnav"> <?php $recent_posts = wp_get_recent_posts( $business );?> <?php foreach( $recent_posts as $recent ): ?> <li> <div class="catgimg2_container"> <?php echo '<a href="' . get_permalink($recent["ID"]) . '">' . get_the_post_thumbnail($recent["ID"]).'</a>' ?> </div> <h2 class="catg_titile"><?php echo '<a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a>' ?></h2> <div class="comments_box"> <span class="meta_date"><?php echo get_the_date($recent["ID"]) ?></span> <span class="meta_comment"><?php echo '<a href="' . get_permalink($recent["ID"]) . '">' . comments_number( 'no responses', 'one response', '% responses' ) .'</a>' ?></span> <span class="meta_more"><?php echo '<a href="' . get_permalink($recent["ID"]) . '">Read more</a>' ?></span> </div> </li> <?php endforeach; ?> </ul>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘get_the_date($recent[“ID”]) not working’ is closed to new replies.