• hi technical gurus!

    im a noob at this so im need some help. ive created a custom template and im wanting to display 5 latest posts in a column i have, problem is, i can only get the titles of the posts and not the content.

    this is what i have so far:

    <?php
    if (is_page()) {
      $cat=get_cat_ID($post->post_title); //use page title to get a category ID
      $posts = get_posts ("cat=$cat&showposts=5");
      if ($posts) {
        foreach ($posts as $post):
          setup_postdata($post); ?>
          <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
        <?php endforeach;
      }
    }
    ?>

    any help would be much appreciated, thanks.

  • The topic ‘display posts on homepage’ is closed to new replies.