wp_dropdown_categories and custom taxonomy + custom post type

You can get your code to work the expected way by adding the following three arguments to your $args array which you pass to wp_dropdown_categories(): name — the select name as in <select name=”<here>”>, and you should set it to theme which is your custom taxonomy slug. value_field — the value of the <option>‘s in … Read more

List archived posts by subcategory

In your Avada’s child theme update your category.php, if its there or else create new file with that name and add the code as below: <?php $current_cat = get_queried_object(); echo ‘Heading: ‘.$current_cat->name; $subcategories = get_categories( array( ‘parent’ => $current_cat->term_id ) ); if(!empty($subcategories)){ foreach($subcategories as $cat){ echo ‘<br>’.$cat->name.'<br>’; $cat_posts = get_posts( array( ‘posts_per_page’ => -1, ‘category’ … Read more

Can you have a single set of “canonical” categories shared by all blogs?

A more elegant solution would be to create a MU (must use) plug-in and drop it on the network. This plug-in would check (per-site) if the categories exist and, if not, add them as appropriate. Here’s some untested example code: <?php $default_categories = array( ‘my_first_cat’, ‘my_second_cat’, ‘my_third_cat’ ); foreach($default_categories as $cat) { if( get_cat_ID( $cat … Read more

wordpress wp_list_categories

Hi @matt ryan: Simplest way to do what you want is to use PHP output buffering. I haven’t tested it yet but this should work: ob_start(); wp_list_categories( $args ); $html = ob_get_clean(); echo str_replace(get_bloginfo(‘wpurl’),”,$html); UPDATE You could also using the ‘wp_list_categories’ hook like this: add_action(‘wp_list_categories’,’mysite_wp_list_categories’); function mysite_wp_list_categories( $output ) { return str_replace( get_bloginfo(‘wpurl’),”, $output ); … Read more

Disallow categories from this MySQL query

You could use the get_tax_sql() function introduced in WP 3.1: $tax_query = array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array( 4, 6, 7, 9 ), ‘operator’ => ‘NOT IN’ ) ); $clauses = get_tax_sql( $tax_query, $wpdb->posts, ‘ID’ ); … “SELECT ID, post_date, post_date_gmt, comment_status, comment_count FROM $wpdb->posts {$clauses[‘join’]} WHERE post_status=”publish” AND post_type=”post” {$clauses[‘where’]} ” … … Read more

List Terms in Category

Since you are in a category the your query will get the posts of that category, you only need to add ‘posts_per_page’ => -1 to that query so it will get you all the posts in that category and not the default “at most” number. so something like: query_posts( $query_string . ‘&posts_per_page=-1’ ); this will … Read more

Is it possible to have WordPress not recognize category URLs?

Look at the code @scribu suggested for a function unregister_taxonomy_from_object_type($taxonomy, $object_type) (the last patch currently). Until the code has found its way into the core, add it to your functions.php, wrap it into a function_exists() and call it on init. unregister_taxonomy_from_object_type( ‘category’, ‘post’ );