Exclude category doesn't work while the codex says it should.
-
Hello,
I try to exclude two of my category’s on a custom Archive page.
This is my code and it only exclude one category it doesn’t do multiple while the WP Codex says it has to by a comma,
<h3 class="archive-heading">Categories:</h3> <ul> <?php $args=array( 'orderby' => 'name', 'order' => 'ASC', 'exclude' => 1,12 ); $categories=get_categories($args); foreach($categories as $category) { echo '<li class="archive-cat-list"><span><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> '; echo '('. $category->count . ')</span></li>'; } ?> </ul>
Very strange i think.
It takes ID 1 but not ID 12.
I have try to exclude other ID’s just to test it but it can only exclude one ID in this code.Little WP Glitch?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Exclude category doesn't work while the codex says it should.’ is closed to new replies.