WordPress.org

Ready to get started?Download WordPress

Forums

Create ARCHIVE link? (5 posts)

  1. macwise
    Member
    Posted 9 years ago #

    I currently have an "Archive" link on my site, in the header nav bar. I am wondering what the heck I am supposed to do with it, as I cannot seem to get it to link to the category page correctly.

    Do I insert the PHP snippet:
    <?php wp_get_archives('type=monthly&show_post_count=true'); ?>
    or is that way off base?

    Thanks for everybody's response. I'll get this yet.

  2. Kafkaesqui

    Posted 9 years ago #

    The link was a choice by the theme designer, and what you put there in its place is up to you. However, that 'snippet' would list all archives links, and not just a link to archives. I suspect it would not be what you want.

    One option you have is to create an "archive" Page (Create > Pages) and assign a template to that Page which provides a list of your archives links. An example of that is provided here:

    http://codex.wordpress.org/Pages#Examples_of_Pages_and_Templates

  3. macwise
    Member
    Posted 9 years ago #

    Ok, I have this page somewhat hacked to give me an archive page, but the formatting is wrong now, and I don't know enough about PHP or xhtml to figure it out on my own. Can anyone take a look and tip me off as to the problem? Thanks.

    Here is the page:
    http://redlens.com/brooks/journal/archives/

  4. Kafkaesqui

    Posted 9 years ago #

    Try to compare your template with the single.php of your theme, and where The Loop appears in the template, that's where you want to place your get_archives tag (i.e. replacing The Loop code).

  5. macwise
    Member
    Posted 9 years ago #

    Thanks, that worked splendidly, after I did a little tweaking to make it work with my theme. You guys are geniuses.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.