Make parent category not selectable when it has child categories

I’m trying to find a way of disabling the selection of the parent category within WordPress 3.5.1 (post editor screen) only when that parent category contains child categories. My structure: Category 1 (no children, allow users to post, keep selection option) Galleries (parent category WITH children, remove selection option to stop users posting) User 1 … Read more

Add class to items in wp_list_categories()

I have this in my category.php to show sub-subcategories: <?php if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != “”) { echo “<ul>”; wp_list_categories(‘orderby=id&show_count=0&title_li= &use_desc_for_title=1&child_of=”.$this_category->cat_ID); echo “</ul>”; } }?> <ul> <li class=”cat-item cat-item-5″> <a>subcategory</a> <ul class=”children”> <li class=”cat-item cat-item-6″><a>sub-subcategory1</a></li> <li class=”cat-item cat-item-7″><a>sub-subcategory2</a></li> </ul> </li> </ul> Is it possible to add a class with the sub-subcategory … Read more

Category tree is flattened inside admin upon saving

Is there a way to avoid WordPress “flattening” the category tree when a child category is selected? This applies to both custom taxonomies and WP’s built in “category” taxonomy. To explain further, say I have the following category tree: Parent Child Grandchild Another parent Another child Another child A third parent If I then select … Read more