WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've a custom/static "homepage.php" in my templates directory at my WordPress. Now I need to show differents "page excerpts" in my homepage, but I don't know what should be do it.

At this moment I've in my "functions.php" de following function:

function excerpt_page() {
  add_post_type_support( 'page', 'excerpt' );
add_action('init', 'excerpt_page');

With this function, I've in my Page editor a new field available where I can put an summary of the page.

Somebody has any idea?

share|improve this question

Not sure if this is what you looking for... To display excerpt of specific page, you can use this code:

    $post_id = 2; // substitute to your page id
    $my_post = get_post($post_id);
    echo "<p>$my_post->post_excerpt</p>";
    echo '<a href="'.get_permalink( $post_id ).'">read more</a>';
share|improve this answer
up vote 0 down vote accepted

Thank you very much!

Finally, I've succeeded with the following code :D

$pages = get_pages('include=10,20,30,40,50,60');
foreach ($pages as $page) {
  $featured_content = '<div class="four columns">'.
                        '<h4><a href="'. get_page_link($page->ID) .'" title="'. $page->post_title .'">'. $page->post_title .'</a></h4>' .
                        '<p>'. $page->post_excerpt .'</p>' .
  echo $featured_content;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.