Is there a way in WordPress that I can make a custom meta box in the post Add/Edit screen that includes a drop down menu to enable the post author to select the category of the post, and then save the choice of the author normally into the WordPress database?
Leave a Reply
You must be logged in to post a comment.
WordPress allows for multiple categories in a post, which is why this page includes a Categories meta box with checkboxes, rather than a drop down.
If you do not see this meta-box when adding/editing a post, you’ll need to click on “Screen Options” in the upper right, then check “Categories”.
If you do not see that option in Screen Options, then likely this has been disabled via a custom plugin or theme.
But let’s assume you want to only allow one category per post. You’ll need to remove the current category meta box, and replace it with your custom meta box.
So, in a plugin, or your theme’s functions.php file, you’ll want to do something like this: