WordPress.org

Ready to get started?Download WordPress

Forums

Excerpts help (3 posts)

  1. APM
    Member
    Posted 8 years ago #

    So I've decided just to customize a theme rather than try to integrate the blog into a page, because that wasn't working very well.

    I still can't find any documentation on putting the excerpts on my main page though.

    Right now, i have this code entered, as per a previous instruction:

    <?php
    $how_many=5; //
    require_once("blog/wp-config.php"); // ?>

    <ol id="whats-new">
    <?
    $news=$wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts
    WHERE post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    printf ("

  2. %s
  3. ", $np->ID,$np->post_title);
    }?>

    That gives me the last 5 entries, and it seems to work fine.

    What code do i need to enter in there (and where) to also include the excerpts for the 5 links? I need to link a little more than just the entry subject.

  • schulte
    Member
    Posted 8 years ago #

  • tomhanna
    Member
    Posted 8 years ago #

    The_Excerpt

    <?php the_excerpt(); ?>

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags