The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Excerpts help (3 posts)

  1. APM
    Posted 11 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:

    $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
    Posted 11 years ago #

  • tomhanna
    Posted 11 years ago #


    <?php the_excerpt(); ?>

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic