Category Navigation on single.php
-
Hi!
I have a tricky question. I use a category-based navigation with subcategories and posts. I have the category navigation on top and a local navigation (on the left) shown below. what i need is that the working code for the category-page also works on the single.php or i use a different one with the same result:
THATS WHAT I WANT ( https://www.goodandbad.net/sport-akustik/category/know-how/ ):
title category parent category
– posts in category
subcategory 1(if existion)
– posts in subcategory
subcategory 2(if existion)
– posts in subcategoryHERE IS THE CODE:
<backticks>
<h2><?php echo $catname; ?></h2>
<?php $categories = get_categories(“child_of=5”); foreach ($categories as $cat) { ?>
<?php query_posts(“cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name”); ?>
<h3><?php single_cat_title(); ?></h3>
<?php while (have_posts()) : the_post(); ?><div class=”what”>
<h3>” rel=”bookmark” title=”Permanent Link to
<?php the_title_attribute(); ?>”><?php the_title(); ?></h3>
</div>
<?php endwhile; ?>
<?php } ?></backticks>
- The topic ‘Category Navigation on single.php’ is closed to new replies.