I want to have a cite underneath my blockquote, that has a certain style.

"Blockquotes are an essential part of a fancy website."
                                                – Cite

The markup should look like this:

<blockquote><p>Blockquotes are an essential part of a fancy website."</p>

But the WYSIWYG-Editor does not offer me the possibility to define a cite for the blockquote. And I can't force my users to write the HTML by hand.

Is there a way to make the WYSIWYG-Editor generate the required markup?

  • Is this the same question as stackoverflow.com/questions/19540789/… or somehow essentially different? – Jukka K. Korpela Oct 23 '13 at 12:21
  • 1
    It actually isn't clear that that is a different question, nor is it entirely clear what you want with this question. Are you asking how to make the WYSIWYG editor generate all of that markup? – s_ha_dum Oct 23 '13 at 13:15
  • 1
    I think he's just trying to get the WYSIWYG editor to add in the Cite markup. – Howdy_McGee Oct 23 '13 at 13:50
  • 1
    -1 for "Preferably not another plugin..." A Plugin is the proper way to extend functionality to implement a solution for this issue. – Chip Bennett Oct 23 '13 at 14:26
  • 2
    That is why I said "preferably" not "I want definitely no plugin, I hate plugins". What I meant is just: If there is a simple sollution, like adding two lines of code to functions.php, I would prefer that. (Instead of adding the Mega-Editor-Markup-Plugin-Pack for WP.) – Sebastian Starke Oct 23 '13 at 16:17

The TinyMCE Custom Styles Codex Page should get you through this.

There are code snippets on that page, but, as an overview, the process requires two steps:

  1. Add the TinyMCE "styleselect" element to the first or second row of icons.
  2. Add one or more elements to that styleselect menu.

If this were me, I would consider also removing the blockquote button from TinyMCE and then adding blockquote as an option in the styleselect along with cite. Doing it that way means your editors can find the correct markup for an entire blockquote in one place.

And I hope this goes without saying, but make sure to implement a custom editor-style.css file so that the blockquote and cite styles match the theme output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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