WordPress.org

Ready to get started?Download WordPress

Forums

Recent Pages (8 posts)

  1. Jabbok
    Member
    Posted 9 years ago #

    Now that we can add pages to our blogs, I would like a plugin that will pull up "Recent Pages" .... similar to "Recent Posts".

    Can someone make me one please?

    Thanks!

  2. oriecat
    Member
    Posted 9 years ago #

    If you use MtDewVirus's Recent Posts plugin, all you need to do is change the post_status from 'publish' to 'static'.

    http://dev.wp-plugins.org/browser/recent-posts/branches/wp-1.5/

  3. Jabbok
    Member
    Posted 9 years ago #

    Yes, but that would interfere with my recent "Posts". I need a seperate plug-in so I can display both recent posts and recent pages.

  4. Kafkaesqui

    Posted 9 years ago #

    You should be able to change one line in the plugin to get both--from this:

    $request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' ";

    to this:

    $request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE (post_status = 'publish' OR post_status = 'static') ";

    To have one for each, copy the plugin and give different names to the filename (recent-pages.php), the plugin name (Recent Pages), and the function (mdv_recent_pages). Then just make the change oriecat suggests in your *new* plugin.

  5. oriecat
    Member
    Posted 9 years ago #

    Well I think he wants both, but separate. Just change the references of posts to pages and rename the file:

    Copy and rename to recentpages.php
    Change the plugin name to Recent Pages
    Change the description to pages
    Change the function to mdv_recent_pages
    Change the post_status to 'static'
    Put in template as <?php mdv_recent_pages(); ?>

  6. oriecat
    Member
    Posted 9 years ago #

    Oh you edited on me :)

  7. Kafkaesqui

    Posted 9 years ago #

    ;)

  8. Jabbok
    Member
    Posted 9 years ago #

    That worked.
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.