adding child categories kills my if (in category)
-
Hi everybody! I try to get this to work: <?php if ( in_category( 5 ) ) { ?> <br> <?php wp_list_categories('child_of="5"&title_li=');?> <br> <?php wp_get_archives('type=monthly'); ?> <br> <?php wp_list_authors('show_fullname=1&optioncount=0&exclude_admin=0&orderby=post_count'); ?> <?php } elseif ( in_category( 6 ) ) { ?> <br> <?php wp_list_categories('child_of=6&title_li=');?> <?php } elseif ( in_category( 7 ) ) { ?> <br> <?php wp_list_categories('child_of=7&title_li=');?> <?php } elseif ( in_category( 8 ) ) { ?> <br> <?php wp_list_categories('child_of=8&title_li=');?> <?php } else { ?><br /> <?php } ?>
the weird thing is, that parts of the code work quite well. I can get
<?php wp_list_categories('child_of=6&title_li=');?>
to work out of the code, and the first if worked partially (showing me “no categories” and the archive and the authorlist before I decided to give category 5 some subcategories for my list_categories(‘child_of=”5″&title_li=’) to find.After I gave cat 5 some subcategories, nothing gets shown anymore. Not even archive nor author.
what do do? I need the childs to be shown, and Archive and Author.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘adding child categories kills my if (in category)’ is closed to new replies.