Show category-ID in custom category-list

Try this: <div id=”category-list”> <ul class=”topnav”> <?php if (is_single()){ global $post; $pid = $post->ID; $post_categories = wp_get_post_categories( $post->ID ); $cats = array(); foreach($post_categories as $c){ $cat = get_category( $c ); $cats[] = $cat->ID; } $active_cat_count = true; $cat_count = 0; } $kategorien = get_categories(array( ‘child_of’ => 0, ‘exclude_tree’ => 15, ‘exclude’ => 16, ‘orderby’ => … Read more

Page view: Sorted by categories

The sorting by taxonomies is strongly discouraged by design. From your image I think that what you want is multiple secondary loops per category is what you want, and your code does have something like that – except that you are overusing query_posts() in a way it should not be used. Basically read up on … Read more

List all authors by matching custom meta data on a category page

Try the WP_User_Query, something like: $term = get_queried_object(); $users = new WP_User_Query(array( ‘meta_key’ => ‘your_meta_key’, // the key in which you store your terms ‘meta_value’ => (int)$term->term_id, // assuming you store term IDs )); print_r($users->get_results()); A update based on your input: $term = get_queried_object(); $user_query = new WP_User_Query(array( ‘role’ => ‘subscriber’, // or whatever your … Read more

Query pages by category

It’s because the default query is only querying for post_type post, you have to explicitly add page to get it to also query for pages: $args = array( ‘cat’ => $current, ‘post_type’ => array( ‘page’, ‘post’ ) ); query_posts( $args );