WordPress.org

Ready to get started?Download WordPress

Forums

Creating yearly archive list (in sidebar) for custom post types (1 post)

  1. caledoniaman
    Member
    Posted 1 year ago #

    I have a theme I'm working with at the moment. I have three types of content (other than pages) which make up the content of the site.

    News (category)
    Articles (category)
    Events (custom post type)

    Sidebar for news and articles are displaying correctly as per the link below. Quite simply, I want to present a year archive in the sidebar for the 'Events' in the format below.

    http://img341.imageshack.us/img341/1999/s392341525websitehomeco.png

    I'm currently generating this using the following code, however as you can see from the image it is pulling back all years (there are currently only events listed in 2011 and 2012) and all post types.

    http://pastebin.com/Ja3x8YT0

    Here is the call to declare the custom post type in functions.php

    http://pastebin.com/GgL3aCPe

    NB: I've tried setting the post_type=event and post_type=Event as well with the same results.

    Any and all help greatly appreciated before I go bald from pulling my hair out.

Topic Closed

This topic has been closed to new replies.

About this Topic