• Hi,
    i’m trying to find a way to change the checkbox for the categories into the post page to radiobutton. I found nothing in the code (i don’t know a lot PHP) and nothing on the web. Where can i change this?

    Thx for help

Viewing 7 replies - 1 through 7 (of 7 total)
  • We do not recommend changing the core programming files, which would need to be changed in order to make this modification. Is there a specific reason for such a change? Clicking a box and clicking a circle isn’t much different in technique, just look.

    Creating Admin Themes will help you with some of the CSS modifications of a WordPress Administration Theme, which might help.

    I take it you’re talking about editing a post in admin? If so, the reason why they are checkboxes is because yoy can have a post in multiple categories, so this is by design. Having a radiobutton wouldn’t work because that would force you to have a post in only one category.

    Thread Starter bumpert

    (@bumpert)

    It’s exactly why i would like to have a radiobutton instead of a checkbox. I’m programmer but not a PHP one. Making only Java, C, C++, SQL, … so not sure to be able to change this by myself (the code looks very well coded).

    Edit the file /wp-admin/admin-functions.php and look for the function “write_nested_categories()”. You will find the call to “type=checkbox” in there, just change that to radio to get the functionality you want.

    In my VERY limited testing, I had no problems with that change, but your mileage may vary.

    Regards

    Thread Starter bumpert

    (@bumpert)

    thx a lot 🙂

    You will find the call to “type=checkbox” in there, just change that to radio to get the functionality you want.

    This will force all posts to only be allowed in one category. I assume this is what you want?

    just surfed to this topic… first of all it does not force ALL future posts to one category. it just lets you choose ONE category for any particular post. i am trying to do this and i now have two drafts here each in their respective categories after changing the inputs to radio buttons.

    asking why someone wants to do this..? erm, because perhaps we want to limit a user to be able to post to one category at a time. no, i don’t mean ONLY one category. i mean to let them choose from the list of categories and post to ONE at a time. i’ve seen this discussion taken off topic before, please try and understand.

    this does work, but at the moment only for the admin, my lower level users still have checkboxes. strange 😮

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

The topic ‘Change checkbox to radio button’ is closed to new replies.