My employer specializes in creating websites for middle-sized businesses. We rarely create “Mom’n’Pops” websites and generally don’t pursue contracts with major corporations. Working with mid-size business has given me the opportunity to speak with executives and “decision-makers” within each business. Our discussions eventually end up with the other person telling me about their previous web […]
get post publish date outside the loop in wordpress
To get post publish date outside the loop in wordpress use the following code. [php] $all_posts = get_posts(array(‘numberposts’=>-1, ‘post_status’=> ‘publish’)); //Get all published posts foreach ($all_posts as $single_post){ echo get_the_time(‘Y-m-d’, $single_post->ID); //The date is on Y-m-d format echo ‘<br />’ ; } [/php] Hope this code will help you. Thanks