This is a really basic question about WordPress functionality.
If I was making a static site and I wanted to apply special styles or code to a few words in my content I would use <span class="">. Is there some way to do this in WordPress? More specifically I want to allow the user to add content in a custom field, but be able to tag a few words in that content as say class=”movie-title”.
That way I can style the class in a particular way without relying on the user to apply consistent styling.
Edit: Solved— For anyone reading this I simply decided to create custom shortcodes which added span tags with a class around the the content. This only works in Advanced Custom Fields if you use a WYSIWYG field. I also added a button in the tinyMCE editor which automatically inserts the custom shortcode around a highlighted word when clicked.
I think that what you need is this: TinyMCE Advanced. According to the description, it will:
“Imports the CSS classes from the theme stylesheet and add them to a drop-down list.” I haven’t used it myself, but from what I’ve heard it’s quite flexible.
If you want to be able to use it in custom fields, you should also take a look at Advanced Custom Fields. It will allow you to add the TinyMCE editor to them.