WordPress.org

Ready to get started?Download WordPress

Forums

Archives page (2 posts)

  1. pramclub
    Member
    Posted 7 years ago #

    My theme doesn't have an archives page, but it does have the following code in the main index.php (sidebar section):

  2. <?php _e('Archives'); ?>
      <?php wp_get_archives('type=monthly'); ?>

      When I've created my page, will WP automatically archive posts, or do I have to do something? I've been reading up on this, but I'm not sure how this works.

      TIA

  • AlexandreP
    Member
    Posted 7 years ago #

    I'm not sure to understand what you mean.

    When you create and publish a post in WP, it gets automatically archived, meaning it automatically appears in an archive page (i.e. when you browse your blog's categories or on a date-based page).

    The wp_get_archives('type=monthly') function returns a list of months where blog posts have been posted. Each of these months are clickable, and brings you to an archive page where all posts published in this month are shown.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags