Forums

[resolved] How to add "Latest Posts" link to home static page (3 posts)

  1. Spider58
    Member
    Posted 3 years ago #

    I have made my home page as a static page. I want to show the "Latest Posts" on the bottom of that page which will make it more dynamic. I know this requires a loop but I'm not familiar with creating one.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    This plugin is very flexible for something like that:
    http://wordpress.org/extend/plugins/recent-posts-plugin/
    Need to also install http://wordpress.org/extend/plugins/post-plugin-library/

    If you don't like the plugin route, here's some code for your page template that you would put AFTER your existing loop:

    <?php
    $posts=get_posts('numberposts=5');
    if ($posts) {
    foreach($posts as $post) {
    setup_postdata($post);
    ?>
    <?php the_time('m.d.y') ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    
    <?php }
    }
    ?>
  3. Spider58
    Member
    Posted 3 years ago #

    Thanks MichaelH I'll try one of those

Topic Closed

This topic has been closed to new replies.

About this Topic