How To Create A WordPress Archives Page


How To Create A WordPress Archives Page

If you are tired to gave a cluttered WordPress side bar, you can always de-clutter it by creating an archives page for archive links which can be listed by categories and months. In order to see what you are going to add, check the Wpdesigner’s archives.

The next step is to go to your WordPress extra page template for an archive page, and search the folder for unused PHP template file. This template is usually named by theme authors archives.php, while in the default archive template it’s written without the “s”, ie archive.php.

You need to know that this tutorial contains he basics instructions for creating an archives page. It can’t be applied for all WordPress themes, because each theme has its own structure and the steps might work different. This is just an example. Just follow these steps:

  • First, you have to create a new file called archives.php.

  • At the top of the file introduce the following code:

Template Name: Archives Page

Be sure that you type the code exactly as it is, if not, you won’t be able to use the archive template file.

  • The next step is to add the loop, title, category listing, and month listing:

<?php while(have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <ul><?php wp_list_cats(‘sort_column=name&optioncount=1?) ?></ul> <ul><?php wp_get_archives(‘type=monthly&show_post_count=1?) ?></ul> <?php endwhile; ?>
  • The next step is to make the code above fit with your current theme, by tweak it.

  • Next, you have to upload your Archive page template.

  • The final step is to create a new page and select the Archive page template that you uploaded.

Wordpress Archives

    Tags: page, template, archives, archive, wordpress, file, next, code, create, theme, archivesphp, steps, creating, just, listing, exactly, able, type, wont, introduce, follow, example, different, work, these, first, following, loop, called, name