• Resolved tara_irvine

    (@tara_irvine)


    I’ve used <?php wp_get_archives('type=monthly&show_post_count=1'); ?> before and it displays a list of months taking you to archive.php and a list of full posts all from that month.

    This new site I’m working on when I use <?php wp_get_archives('type=monthly&show_post_count=1'); ?> The list I click on leads me to single.php, I just want to know why? Is there any way that the archives links go to archive.php instead? I don’t want one post per page.

    Regards Tara

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Are you sure it is single.php? If I read the template hierarchy right single.php is only used for “Single Post display” and “Attachment Templates”

    Thread Starter tara_irvine

    (@tara_irvine)

    yep i put comments on each page so i can tell which template is appearing, I’m using this though, think it’ll make a difference?

    <?php
    $category = get_the_category();
    $currentcat = $category[0]->cat_ID;
    ?>
    <?php
    $category = get_the_category();
    $currentcat = $category[0]->cat_ID;
    if (file_exists(TEMPLATEPATH."/single-$currentcat".".php")) {
    include(TEMPLATEPATH."/single-$currentcat".".php");
    } else {
    ?>

    I have a single-8.php which only is in use when the single posts for news category are visible.

    Thanks for the really quick reply 🙂

    Thread Starter tara_irvine

    (@tara_irvine)

    date.php did the trick, if I have that I can put all my lovely monthly archives in there.
    cheers

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_get_archives’ is closed to new replies.