WordPress.org

Support

Support » How-To and Troubleshooting » get_page – formatting date

get_page – formatting date

  • I am trying to create template which shows list of childern of current page. I am using this code

    <ul>
    <?php
    $articles = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');
    foreach($articles as $page)
    {
    ?>
    <li><?php echo $page->post_date; ?> - <a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title; ?></a></li>
    <?php
    }
    ?>
    </ul>

    However, output from this code has exact date, including seconds (for example 2011-02-01 07:55:54). Is there any way to format this date to something like “day/month/year”?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_page – formatting date’ is closed to new replies.