Listing authors and date archive from custom post type

This should have been two different questions but anyway, I needed to use wp_list_authors for custom post type so i created this function: function get_authors_ids_by_post_type($type = null,$args=””){ if ($type === null) return; global $wpdb; $defaults = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘number’ => ”, ‘optioncount’ => false, ‘exclude_admin’ => true, ‘show_fullname’ => false, … Read more

How to exclude categories from a sidebar with active widgets in it?

If i understand correctly, a quick solution could be using something like Widget Logic and create a custom menu for each category, then use whatever Conditional Tags applies.// such as is_category() or in_category( ‘5’ ) Or, if you don’t want to use a plug-in, you could try duplicating the widget and then adding the conditional … Read more

Can I bind a post_type=’post’ category to a custom post_type category?

If you need to register the built in category taxonomy for a custom post type you can do this by using the priority argument when adding an init action hook. add_action( ‘init’, ‘add_category_to_post_types’, 11 ); function add_category_to_post_types() { register_taxonomy_for_object_type( ‘category’, ‘my_post_type’ ); } The third argument in the add_action() call sets a priority so most … Read more

Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category

Well, I do not know if this is quite OK, but is returning the expected results … so at the moment this it is enough for me. function my_custom_get_terms( $my_tax, $my_category, $show_all = true ){ global $wpdb; global $pagename; $query = “SELECT Count(wp_posts.ID) AS my_term_count, wp_term_taxonomy.term_taxonomy_id, wp_term_taxonomy.taxonomy, wp_terms.name, wp_terms.term_id, wp_terms.slug AS term_slug, wp_terms.term_group, wp_terms_1.slug FROM … Read more