• Hi

    I was just wondering if someone could adjust this code to display an excerpt rather than the full content and to pull the date and time from a page.

    I seem to be having trouble with it and any help would appreciated.

    I got the code from here:
    http://codex.wordpress.org/Function_Reference/get_pages#Displaying_Child_pages_of_the_current_page_in_post_format

    <?php
        $mypages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');
        $count = 0;
        foreach($mypages as $page)
        {
            $content = $page->post_content;
            if(!$content)
                continue;
            if($count >= 2)
                break;
            $count++;
            $content = apply_filters('the_content', $content);
        ?>
            <h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2>
            <div class="entry"><?php echo $content ?></div>
        <?php
        }
    ?>

    Regards

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Adjust code to display excerpt and date/time’ is closed to new replies.