Load custom category template?
-
My last post got accidentaly closed somehow. Here it is again:
Hello. I have made my own integrated theme (Ztheme), with the templates in ../themes/ztheme – but the ‘index.php’ is moved to the root, because it’s my main page.
Anyway, I want a specific category to show up in a modified template, so I make it and name it category-15.php, and upload it to my Ztheme folder. It refuses to work. I’ve also tried to upload ‘archive.phph’ and ‘category.php’ – but it still uses ‘index.php’.
What could be the solution here?
Even though I change theme back to the default, my categories still show up using the ‘index.php’-page rather than the default theme’s ‘archive.php’ as it should according to the template hierarchy.
How can I force it to use a certain template for say, Category 15? It just does not work.
I would be very grateful for help.my index code:
<?php /** * @package WordPress * @subpackage Ztheme */ require('./eventz/wp-blog-header.php'); get_header(); ?> <div id="mainContent"> <div class="frontpage"> (here's some static images and text that gets displayed on all pages) </div> <!--End of frontpage--> <div class="blogcontent"> <!--excludes posts from category 15 (articles) on the mainpage--> <?php if ( is_home() ) {query_posts($query_string . '&cat=-15'); } ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php the_time('Y-m-d') ?> <!-- by <?php the_author() ?> --> <img src="https://zetterstrand.com/logos/squareFF6600_2.gif" alt="sq" width="20" height="27" /> <h2><a style="text-decoration:none; color: #333333;" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <!--<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> --> Posted in <?php the_category(', ') ?> <!--| <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>--> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> </div> <!-- end #blogcontent --> <!-- end #mainContent --> </div> <div class="sidebar"> Blog categories: <?php wp_list_categories('hierarchical=0&title_li='); ?> </div> <div id="rss"> <span class="styleKZsmall">Subscribe to posts [RSS]</span> <a title="RSS Feed of Posts" href="<?php bloginfo('rss2_url'); ?> "><img src="/logos/rss.png" alt="Subscribe to posts [RSS]" width="16" height="16" vspace="0" border="0"/> </div> <?php get_footer(); ?>
- The topic ‘Load custom category template?’ is closed to new replies.