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

  1. caledoniaman
    Posted 3 years 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.


    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.


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


    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