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’ );

How to disable category without deleting?

I have solved the problem myself, but it is not a pretty one. With the function attached to the add_meta_boxes action hook, I change the callback function that builds the category box. It replaces this function with the customized function post_categories_meta_box_custom. post_categories_meta_box_custom is a copy of post_categories_meta_box from wp-admin/includes/meta-boxes.php. With the help of simple-html-dom the … Read more