• Resolved travelbug2007

    (@travelbug2007)


    Hello,

    I have read several posts about this topic, and can’t find where to change the number of recent posts showing up in my sidebar.

    Am I supposed to do something with this line in the sidebar.php? I see it has a number 1, but it is 5 posts that are showing. I have posted my full sidebar.php below.
    <?php wp_get_archives(‘type=monthly&show_post_count=1’); ?>

    In my left sidebar is says I am using 1 widget and I see the recent posts widget is there, when you click on it, it does nothing, there is not option to change anything. I also looked for widget.php to see if I could change something there, but I don’t see anything called widget.php? Can someone offer any help.
    Thank you kindly

    My website is If it needs to be looked at to help with the soloution.

    <div id=”sidebar” class=”sidebar”>

      <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Right Sidebar’) ) : else : ?>
    • <h3><?php _e(‘Pages’); ?></h3>
      <?php wp_list_pages(‘title_li=’ ); ?>
    • <h3><?php _e(‘Search’); ?></h3>
      <form id=”searchform” method=”get” action=”<?php bloginfo(‘siteurl’)?>/”>
      <input type=”text” name=”s” id=”s” class=”textbox” value=”<?php echo wp_specialchars($s, 1); ?>” />
      <input id=”btnSearch” type=”submit” name=”submit” value=”<?php _e(‘Go’); ?>” />
      </form>
    • <h3><?php _e(‘Categories’); ?></h3>
      <?php wp_list_categories(‘show_count=1&hierarchical=1&title_li=’); ?>

    <?php endif; ?>

    </div>
    </div><?php //closing for #main?>

    <div id=”leftside” class=”sidebar”>

      <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Left Sidebar’) ) : else : ?>
    • <h3>
      <?php _e(‘Monthly’); ?>
      </h3>
      <?php wp_get_archives(‘type=monthly&show_post_count=1’); ?>

    <?php if (function_exists(‘wp_tag_cloud’)) { ?>

    • <h3>
      <?php _e(‘Tags’); ?>
      </h3>
      <p>
      <?php wp_tag_cloud(); ?>
      </p>
    • <?php } ?>
      <?php if(is_home()) {?>
      <?php get_links_list(); ?>

    • <h3>Meta</h3>

    <?php }?>
    <?php endif; ?>

    </div>
    <div style=”clear:both;”></div>
    </div><?php //closing for #outer?>
    <div style=”clear:both;”></div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter travelbug2007

    (@travelbug2007)

    oops!!!! Sorry, messed that post up really bad. I meant to put my website link in and ended up linking my whole post. My website is https://www.parnellpainting.com

    Thread Starter travelbug2007

    (@travelbug2007)

    Hello, me again

    I think I got a little farther along, but still am a bit confused. I found the widget.php The lines that I was told to look for have a number of 15 in both spots, but I only have 5 recent posts showing. I see some lines of code with number 5, but I was not sure if they were the numbers to change to show more entries. I would like more than 5 entries to show. Can someone please tell me where in the widget.php I need to make changes? I only pasted the section of it that I thought was relevant. Please let me know if I am not in the right place at all.

    Thank you

    wp_flush_widget_recent_entries();
    }
    $title = attribute_escape($options[‘title’]);
    if ( !$number = (int) $options[‘number’] )
    $number = 5;
    ?>

    <p><label for=”recent-entries-title”><?php _e(‘Title:’); ?> <input class=”widefat” id=”recent-entries-title” name=”recent-entries-title” type=”text” value=”<?php echo $title; ?>” /></label></p>
    <p>
    <label for=”recent-entries-number”><?php _e(‘Number of posts to show:’); ?> <input style=”width: 25px; text-align: center;” id=”recent-entries-number” name=”recent-entries-number” type=”text” value=”<?php echo $number; ?>” /></label>

    <small><?php _e(‘(at most 15)’); ?></small>
    </p>
    <input type=”hidden” id=”recent-entries-submit” name=”recent-entries-submit” value=”1″ />
    <?php
    }

    function wp_widget_recent_comments($args) {
    global $wpdb, $comments, $comment;
    extract($args, EXTR_SKIP);
    $options = get_option(‘widget_recent_comments’);
    $title = empty($options[‘title’]) ? __(‘Recent Comments’) : $options[‘title’];
    if ( !$number = (int) $options[‘number’] )
    $number = 5;
    else if ( $number < 1 )
    $number = 1;
    else if ( $number > 15 )
    $number = 15;

    if ( !$comments = wp_cache_get( ‘recent_comments’, ‘widget’ ) ) {
    $comments = $wpdb->get_results(“SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = ‘1’ ORDER BY comment_date_gmt DESC LIMIT $number”);
    wp_cache_add( ‘recent_comments’, $comments, ‘widget’ );
    }
    ?>

    <?php echo $before_widget; ?>
    <?php echo $before_title . $title . $after_title; ?>
    <ul id=”recentcomments”><?php
    if ( $comments ) : foreach ($comments as $comment) :
    echo ‘<li class=”recentcomments”>’ . sprintf(__(‘%1$s on %2$s’), get_comment_author_link(), ‘comment_post_ID) . ‘#comment-‘ . $comment->comment_ID . ‘”>’ . get_the_title($comment->comment_post_ID) . ‘‘) . ”;
    endforeach; endif;?>
    <?php echo $after_widget; ?>
    <?php
    }

    function wp_delete_recent_comments_cache() {
    wp_cache_delete( ‘recent_comments’, ‘widget’ );
    }
    add_action( ‘comment_post’, ‘wp_delete_recent_comments_cache’ );
    add_action( ‘wp_set_comment_status’, ‘wp_delete_recent_comments_cache’ );

    function wp_widget_recent_comments_control() {
    $options = $newoptions = get_option(‘widget_recent_comments’);
    if ( $_POST[“recent-comments-submit”] ) {
    $newoptions[‘title’] = strip_tags(stripslashes($_POST[“recent-comments-title”]));

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t get number of recent posts changed, even after reading all topics on it.’ is closed to new replies.