How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?

I think you can go about the filter list_terms_exclusions, but i don`t tested. example: function fb_list_terms_exclusions($args) { if ( ‘media-upload-popup’ != $where ) return $where; if ( !current_user_can(‘manage_categories’) ) $where = ” AND t.slug NOT IN (‘uncategorized’, ‘category-2’)”; // slug of categories return $where; } add_filter( ‘list_terms_exclusions’, ‘fb_list_terms_exclusions’ ); update for the comments to this … Read more

has_term if/echo else/echo function

Problem is that you’d need to pass a $post->ID in order to not return false. Better use is_object_in_taxonomy($object_type, $taxonomy) and fill both the term and the tax in the function. It returns (boolean), so simply add your class based on the result: echo $class = is_object_in_taxonomy( ‘news’, ‘your_taxonomy’ ) ? ‘current-whatever’ : ”; // or: … Read more

Taxonomies for custom post types

For question one, reading the following from the codex makes me think you need to change hierarchical to 1: depth (integer) (optional) The max depth. This is ignore unless hierarchical is set to true. Default: 0/False hierarchical (boolean) (optional) Display all categories (0/False) or display categories (1/True) to a depth of ‘depth’. Default: 0/False

Disabling wp_tag_cloud() outputting inline CSS

The only way to do this is to return the tag cloud as an array since every other tag parameter will still add inline font-sizing. To return the cloud as an array you can use <?php $tag = wp_tag_cloud(‘format=array’ );?> or in a functions.php filter, //tag cloud custom add_filter(‘widget_tag_cloud_args’,’style_tags’); function style_tags($args) { $tag = wp_tag_cloud(‘format=array’ … Read more

How to have two different versions of a tag/category/taxonomy archive page?

My solution at the moment is to use a GET variable to request a different page template: Regular version of taxonomy page: mysite.com/subjects/science Blog version of taxonomy page: mysite.com/subjects/science?view=blog To handle the ?view=blog variable, I add this conditional to the top of taxonomy.php (or taxonomy-subjects.php and any other taxonomy-{slug} that I want to have an … Read more