WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display a list of the Latest Pages (6 posts)

  1. triffendesign
    Member
    Posted 5 years ago #

    I am looking for a good way of displaying the latest pages created. I found this page (http://wordpress.org/support/topic/177575?replies=5), but I neither understand it (and I have a distinct feeling about this) nor do I think it is what I want.

    I am looking for something like a widget I could use.

    Thanks for your time.

  2. MichaelH
    Member
    Posted 5 years ago #

    Get otto's php code widget and try this in that widget

    <?php
    $args = array(
    	'post_type' => 'page',
    	'showposts' => 1
            );
    $posts = get_posts($args);
    if ($posts) {
    foreach($posts as $post) {
    setup_postdata($post);
    ?>
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    <?php
    }
    }
    ?>
  3. triffendesign
    Member
    Posted 5 years ago #

    Thank you much for the reply and the work.

    This kind of works. What is showing up is the page I am browsing on (It switches every time I am on a page).

    Also, if I switch the 'showposts' number to a different number, I would receive more pages wouldn't I?

    Again, thank you for the time.

  4. triffendesign
    Member
    Posted 5 years ago #

    Ah...it does give me multiples. They are the same link, but it does give me multiples.

    I should also show my web page to help: transcendentpath.com

    Again, thank you.

  5. MichaelH
    Member
    Posted 5 years ago #

  6. triffendesign
    Member
    Posted 5 years ago #

    I'll take a look and report back. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic