Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How to make each post/page have one and only one category. Categories could have radio box instead of checkbox next to each.

share|improve this question

3 Answers 3

Actually, I wrote a plugin for exactly that.

http://wordpress.org/extend/plugins/radio-buttons-for-taxonomies/

In the plugin settings you define which taxonomies you'd like to apply this restriction to.

share|improve this answer

My prefered solution would be to use Advanced Custom Field with the Taxonomy field Add-on.

This way you can add a simple html select field for category, and in the same time hide the default wordpress categories widget.

http://www.advancedcustomfields.com/add-ons/taxonomy-field/

share|improve this answer
    
I'll definitely second this. The ACF plugin is great in the first place, and this solution is dead simple. Word of notice, I believe the Taxonomy Field Add-On is ACF 3 only, whereas ACF is now 4 and has Taxonomy fields built-in. Just remove your custom Taxonomies via the Screen Options tab. –  Morgan Delaney Jan 6 at 18:58
    
You're totally right, it's all built-in now :) –  Vincent Wasteels Jan 6 at 22:20

From within the WordPress Admin, I haven't seen anyone modify category selection to force only 1 category. However, a good solution for you might be to use Gravity Forms. Using Gravity forms you can create a "front end posting solution" and in doing this you can set the category selection to use Radio Buttons instead of checkboxes. Alternatively you could also use a dropdown menu, again only allows 1 selection.

Another alternative is to modify the wp-admin area (which you will need to to in order to keep the WYSIWYG portion of the content editor as I don't think the front end solution provides this. I would suggest you remove the standard category meta box, very easily using code from this page: http://codex.wordpress.org/Function_Reference/remove_meta_box

And then create your own categories metabox using a dropdown value, which you can easily create from this page: http://codex.wordpress.org/Template_Tags/wp_dropdown_categories

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.