Support » Requests and Feedback » How to Limit Number of Links Under Monthly Archives in Sidebar

  • Hello,

    It would be very nice if there was an option — perhaps on the “Settings/General” admin page — where we could limit the number of links which are displayed under “Monthly Archives” in the sidebar.

    When one has been running a WP blog for a number of years — as I have — the list of links in this section can grow quite long, and I seriously doubt that most blog visitors are interested in looking back that far in time.

    Perhaps there can be an option where the admin can enter a number — for example, 12, meaning to display only the twelve most recent monthly archives — or even select a month and year from a pull-down menu, as the cut-off date for displayed links.

    No doubt this feature can easily be implemented in a theme by WP admins who are proficient with PHP, CSS, etc. However, for the rest of us who don’t want to fiddle too much with our theme, or create a child theme, it would be nice if this was simply an option somewhere in the settings.

    Thanks for listening.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Have you thought about displaying the list as dropdown menu?

    At Appearance -> Widgets in your blog’s Dashboard, edit the Archives widget active in the widget area and check “Display as dropdown.”

    Thread Starter WordWeaver777

    (@wordweaver777)

    Hello James. Thanks for the suggestion. I suppose that is another way to do it so that there isn’t such a long list of monthly archive links running down the page.

    However, I have also observed over the years that unless you place something right in front of certain people, they will simply ignore it. In other words, for some people, there is less motivation to click on a drop-down menu, than there is to click on a link that is right in front of them.

    Thus, as I pointed out in the other thread, I decided to change the default value for the “limit” parameter from “unlimited” to “12” in wp-includes/general-template.php.

    I’ll just have to add that change to the small list of code changes that I need to make each time that the WordPress codebase receives an update.

    I still don’t understand why editing the “wp_get_archives” function in the sidebar.php file of my theme — TwentyTen — doesn’t work. Is it because the function has been deprecated?

    Thanks!

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    I still don’t understand why editing the “wp_get_archives” function in the sidebar.php file of my theme — TwentyTen — doesn’t work. Is it because the function has been deprecated?

    That’s just for if you’re using the theme’s default widgets. If you add the Archive widget yourself, it’s going to use what’s in general-template.php.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Limit Number of Links Under Monthly Archives in Sidebar’ is closed to new replies.