Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Bug in tag clouds?

    This seems to be still relevant, so here is the solution:

    in wp-includes/category-template.php the function wp_tag_cloud echos the return value, which makes sense if it’s a HTML string but not if it’s an array.

    So if you replace

    if ( is_wp_error( $return ) )
    		return false;
    	else
    		echo apply_filters( 'wp_tag_cloud', $return, $args );

    with

    if ( is_wp_error( $return ) )
    		return false;
    	else if (is_array($return)) {
    	 return $return;
    	} else {
    		echo apply_filters( 'wp_tag_cloud', $return, $args );
    	}
    }

    (line 234ff) to check if the return value is an array then the array-option works.

    I made the same mistake since I automatically assumed that the tags would be copys of, not replacements for the categories (since this was the way the “converter” of my previous tagging plugin worked, the proper meaning of “convert” is not all that obvious if one isn’t a native english speaker). But this seems easy to fix:

    If you have phpMyAdmin (or similiar) installed open the table ‘wp_term_taxonomy’ and change the value of field ‘taxonomy’ from “post_tag” to “category”. As far as is can tell this is (database-wise) the only difference between tags and categories and anyway it worked for me.

Viewing 2 replies - 1 through 2 (of 2 total)