tara_irvine
Member
Posted 1 year ago #
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
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"
tara_irvine
Member
Posted 1 year ago #
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 :)
tara_irvine
Member
Posted 1 year ago #
date.php did the trick, if I have that I can put all my lovely monthly archives in there.
cheers