WordPress.org

Forums

Recent Entries (6 posts)

  1. aaron1728
    Member
    Posted 11 years ago #

    Any hope of an MT-like "Recent Entries" hack so that the titles of the last N entries would be listed and linked?
    Sorry for making a mistake and posting this inquiry incorrectly in the WordPress and XFN forum.
    Thanks in advance.

  2. Matt Mullenweg
    Troublemaker
    Posted 11 years ago #

    get_archives('postbypost', 10);

  3. Anonymous
    Unregistered
    Posted 11 years ago #

    Any chance of an offset on that?

  4. Anonymous
    Unregistered
    Posted 11 years ago #

    this is what i did in my blog, try it.
    <?php
    $blog = 1;
    require_once('blog.header.php');
    function get_recent_posts($limit = 10, $before = '', $after = '
    ') {
    global $wpdb, $tableposts, $now;
    global $siteurl, $blogfilename;
    $posts = $wpdb->get_results("SELECT ID, post_title, post_date FROM $tableposts WHERE post_status = 'publish' AND post_date <= '$now' ORDER BY post_date DESC LIMIT $limit");
    $output = '';
    foreach ($posts as $post) {
    $post_title = stripslashes($post->post_title);
    $post_date = mysql2date('d-m-Y @ h:i', $post->post_date);
    $permalink = "$siteurl/$blogfilename?p=$post->ID&c=1";
    $output .= "$before » $post_title $after";
    }
    echo $output;
    }
    ?>
    <b>Latest 10 Entries</b>
    <?php get_recent_posts() ?>

  5. OperaManiac
    Member
    Posted 11 years ago #

    or u can use RSS Syndication. if that's what u looking for, showing the last 10 posts on the blog on non blog pages of ur site... :)

  6. davidchait
    Member
    Posted 11 years ago #

    That's a good hack... I'll have to think if that ends up being too expensive to do frequently.. Though I guess in a big site, that's a great approach to getting to blogged content.
    d

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.