Support » Plugins and Hacks » Recent posts widget not limiting posts

Recent posts widget not limiting posts

  • i recently imported a movable type archive into a wordpress site that *was* previously working just fine. it did some strange things, but the strangest is whatever happened to the recent posts widget.

    for some reason it’s not listening to the post limiter. i would like 5, but no matter what number i put in there it lists 20. here’s what i’ve done so far to troubleshoot:

    1. disabled all plugins
    2. went in to default-widgets.php and hard-coded 5 into the post output
    3. tried hard coding ‘5’ into post.php
    4. tried installing different widgets to see if a different query type would work

    on the latter, i installed U More Recent Posts, an ajax recent post cycle. on initial load it shows 20 posts, however when it cycles through to the 2nd page of posts it jumps back to 5. then if i navigate back to page 1 it keeps it at 5.

    i also tried deleting all widgets and putting this in sidebar.php

    	$args = array( 'numberposts' => '5' );
    	$recent_posts = wp_get_recent_posts( $args );
    	foreach( $recent_posts as $recent ){
    		echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' .   $recent["post_title"].'</a> </li> ';

    i can’t for the life of me figure out what happened or how to fix it. anyone care to take a crack at this?

Viewing 1 replies (of 1 total)
  • okay, i hard coded this into sidebar.php and it seems to work, however i need to get this in widget form. i still don’t understand why one taxonomy would work and the other wouldn’t.

        $recent_posts = new WP_Query();
            <?php while ($recent_posts->have_posts()) : $recent_posts->the_post(); ?>
            <li><a href=""><?php the_title(); ?></a></li>
            <?php endwhile; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Recent posts widget not limiting posts’ is closed to new replies.