Custom Post Archive Pages - SideBar not returning correct data (4 posts)

  1. FranklynJones
    Posted 4 years ago #

    Hi there,

    I'm pretty new to all of this, so I am probably missing the obvious, but any help would be greatly appreciated.

    I am running the latest version of WP 3.3.1

    I have created a Custom Post Type called ResearchNews, I would like to have an archive page of all theses posts. I have created an archive page called archive-researchnews.php based on the orginal archive.php.

    This works except the sidebar, the sidebar only seems to return non custom post data. I have tried also using the plugin "WordPress Custom Post Type Archive" (http://wordpress.org/extend/plugins/wordpress-custom-post-type-archive/) - this does return some data pertaining to my custom post type, i.e. shows the correct number of posts, and the correct months, but the link i.e. February goes to non custom posts (i.e. http://localhost:8888/egi/?m=201202&post_type=ResearchNews) the &post_type appears not to affect this link.

    How can i make the sidebar return the correct data, i.e. archive links of my CPT?

    I hope this is clear.

    Thanks alot!

  2. keesiemeijer
    Posted 4 years ago #

    How can i make the sidebar return the correct data, i.e. archive links of my CPT

    Do you mean date based archive links? Do you use wp_get_archives() to produce these links, or do you use the archive widged?

  3. FranklynJones
    Posted 4 years ago #

    Yes, I mean the date based Archive link and yes I'm using the archive widget but the sidebar also includes <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> - so both really

    To clarify, my test data has 4x CPT posts spread over January and February, I also have a single regular post for February

    The widget displays Feb and Jan links with the right post count, but the links are wrong, such that the Feb link goes to the regular post, and the Jan link produces a 404 (because there are no reg posts in Jan)..

    The wp_get_archives returns just a link for Feb which goes to the regular post...it does not produce any jan link..

    I hope that makes sense.

    Thanks for your reply...really appreciated.

  4. FranklynJones
    Posted 3 years ago #

    Any updates on this? Driving me loco

Topic Closed

This topic has been closed to new replies.

About this Topic