WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Example of Non WP page which lists recent blog posts (3 posts)

  1. macmiller
    Member
    Posted 6 years ago #

    I'm just wondering if anyone has an example of a non blog page which displays a list of recent blog posts. I would like to look at an example. (I had my page working like this but it no longer works after upgrading WP to 2.3.1). I kind of in a panic trying to repair various problems after the upgrade and any help would be greatly appreciated.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Such an example is rather trivial to create.

    Make a file called, say, temp.php. Put this in it:

    <?php
    require('./wordpress/wp-blog-header.php'); // change this to fit your path
    ?>
    <p>Recent Posts:</p>
    <ul>
    while (have_posts()) : the_post(); ?>
    <li><?php the_title(); ?> </li>
    <?php endwhile; ?>
    </ul>
  3. macmiller
    Member
    Posted 6 years ago #

    That is a good suggestion, it could be tweaked to limit the posts to a pre-defined number also. I found an existing plug-in which I tweaked a bit as an alternative to this method. Thanks a lot for the input Otto.

    The alternative is here:
    http://wordpress.org/support/topic/148957?replies=1

Topic Closed

This topic has been closed to new replies.

About this Topic