WordPress.org

Ready to get started?Download WordPress

Forums

Number of monthly archive links in sidebar (2 posts)

  1. georgia
    Member
    Posted 9 years ago #

    Could someone please tell me how to limit the number of monthly archive links in the sidebar? I'd like to list just three months in the sidebar and have a link to an archive page for more.

  2. Kafkaesqui

    Posted 9 years ago #

    http://codex.wordpress.org/Template_Tags/get_archives

    <?php get_archives('monthly', 3); ?>

    You'll probably want to do something like this:

    <ul>
    <li>Archives
    <ul>
    <?php get_archives('monthly', 3); ?>
    <li><a href="/your/more/link/">all archives</a></li>
    </ul>
    </li>
    </ul>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.