WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Recent Post for Page (not widget) (7 posts)

  1. thedangerouslybeavers
    Member
    Posted 4 years ago #

    Hey all,

    I was wondering if there was a way to display the same code for the recent posts widget on my home page. I want to be able to make my home page automatically update with the latest posts but I DONT want it on my side bar?

    Any help?

    Thanks

  2. MichaelH
    Member
    Posted 4 years ago #

    There are plugins that provide tags you can add to posts or pages to display recent posts, such as: http://wordpress.org/extend/plugins/yd-recent-posts-widget/

    or you can use a get_posts structure to do that in your theme's template file(s). See: http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/

  3. Shane G
    Member
    Posted 4 years ago #

    Hi,

    Use this code in order to display recent posts:

    <?php query_posts('showposts=5'); ?>

    Thanks,

    Shane G.

  4. MichaelH
    Member
    Posted 4 years ago #

    Wouldn't using query_posts like that suggested by Shane G. I believe will reguire a wp_reset_query(); so to restore the 'main loop' query values?

  5. Shane G
    Member
    Posted 4 years ago #

    Hi,

    My Code was wrapped in the format. Hence, I have posted it again here:

    <?php query_posts('showposts=5'); ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    <?php endwhile;?>
    </ul>

    Thanks,

    Shane G.

  6. mihaicoman
    Member
    Posted 4 years ago #

    Shane G. Hey man thanks a lot for the php code. It worked perfectly on a custom made theme by me :D. Now i'm looking for archives and recent comments (not widget of course). Can you help me out?

    Best regards
    Coman Mihai

  7. pabile
    Member
    Posted 3 years ago #

    thanks Shange G
    just what i needed!

Topic Closed

This topic has been closed to new replies.

About this Topic