WordPress.org

Forums

Linking to generic archives page (3 posts)

  1. sjthomas
    Member
    Posted 4 years ago #

    I'm writing a theme and an trying to generate a link to a generic archives page (i.e. archives.php). By default this is http://www.example.com/archives/ when you have pretty links enabled.

    The problem being that a user can change this URL under permalink options. So how do I get that value to dynamically generate a link to the archives page should a user decide to change that permalink option? Obviously, if a user has chosen to change the URL at which archives can be accessed I want the theme to respect that.

    Any ideas? I'm coming up blank, as are searches.

  2. MichaelH
    Member
    Posted 4 years ago #

    Why not use the template tag, wp_get_archives()?

  3. sjthomas
    Member
    Posted 4 years ago #

    Because that displays a list of dates. The setup I have is I'm using a home.php template file for the homepage. This doesn't contain a typical list of posts. Hence I want to provide a link to a page listing posts, newest first, from every category.

    I know, based on the template hierarchy, that I can use either archive.php or index.php to do this, but I'm struggling to dynamically generate a link to this page based on the user specified pretty link option.

Topic Closed

This topic has been closed to new replies.

About this Topic