Support » Themes and Templates » Single Category Archives

  • hearsaychris

    (@hearsaychris)


    I am breaking into wp and am trying to create custom archives. I have 3 categories, let’s say they are A, B, and C. I am wanting to show just the archives of category A on a single page with a custom template. I also want to have a different template to show just the archives of category B. I also need a 3rd for category C. I know I have already created separate category and single post template files.

    How do I call to this specifically from my sidebar and what code needs to be in my archive.php file?

    Thanks for any help you can send my way.

    Chris

Viewing 8 replies - 1 through 8 (of 8 total)
  • MichaelH

    (@michaelh)


    Just use Category Templates and then WordPress will automatically use the proper template when that Category is clicked say from a list presented by template tag, wp_list_categories().

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    hearsaychris

    (@hearsaychris)


    The catch is that I can’t use wp_list_categories().

    Categories A, B, and C are supposed to look like separate sections of the site. There should be no bleed through, meaning the user cannot see anything remotely related to Category B while in Category A and vice versa.

    Right now I am just calling for the standard monthly archives under my sidebar which shows all posts in all categories and that is not what I need.

    MichaelH

    (@michaelh)


    So where are you presenting the link to get to Category A? or Category B, or Category C?

    hearsaychris

    (@hearsaychris)


    We have a header with links for each Category at the top but we want an archive in the sidebar for each category on it’s own category.php file.

    MichaelH

    (@michaelh)


    I still believe my main point about Category Templates applies.

    hi, i want to do the same as hearsaychris, but i find the category template idea confusing not to mention the actual help pages on it.

    i don’t see why i can’t just make two sidebars A and B,

    then put them both one underneath the other so it may look like :

    –sidebarA–
    pages
    archive 1

    –sidebarB–
    meta
    archive 2

    and then for archive 1 I have :
    <?php wp_get_archives(‘cat=5’); ?>

    and for archive 2 I have :
    <?php wp_get_archives(‘cat=1’); ?>

    …….why is wordpress not this simple? seems like a logical and good starting point for me, but alas ..

    You can do exactly what antistandard wants to do if you use this plug-in:

    http://kwebble.com/blog/2007_08_15/archives_for_a_category

    I agree, however, that wp_get_archives() really should have this functionality.

    Thank you fisherwebdev. The plugin helped me sort the same issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Single Category Archives’ is closed to new replies.