I am trying to figure out how to add a dropdown widget to the post page. The reason I ask is because I would like to be able to have a few different post classes that the user can select while making a post that they can select.
I figure I can use post_class and define a few different classes and allow the user to use this as a post template.
Has anyone done this before and could lead me in the right direction?
Since this is very similar to post formats (see post-formats) I would use a custom taxonomy.
That makes it easy to control the access level, and you get the meta box without writing extra code.
Then you insert the new post classes with a simple filter. Your theme must use the function
post_class()
â of course.Example:
You can use meta box to add box in admin post page and use post_class filter to use it in front end.