Below is my code for the category list displayed on this page
I want to remove the categories 'page-seo' and 'page-seo-1'. I am trying 'exclude=cat_id' which has worked for preventing the actual posts from displaying on this page, but it doesn't work for the list of categories.
Can anybody see what I am doing wrong?
Cheers.
$taxonomy = 'category';
// get the term IDs assigned to post.
$post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
// separator between links
$separator = ', ';
if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) {
$term_ids = implode( ',' , $post_terms );
$terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy . '&include=' . $term_ids . '&exclude=66,67');
$terms = rtrim( trim( str_replace( '
', $separator, $terms ) ), $separator );
// display post categories
echo $terms;
}
includeandexcludeas criteria in the same call (not sure aboutwp_list_categories, but it's true for other functions, such aswp_tag_cloud). What happens if you remove IDs 66 and 67 from$post_termsand only useinclude? - Hobo