In these styles here:

tinymce styles dropdown tags

Can then add a new line called: 'Medium paragraph' and 'Large paragraph', that wraps that content in <p class="paragraph__medium"> ... </p> or <p class="paragraph__large"> ... </p>.

My attempts

I can see that I can add this code here:

 * New custom styles for TinyMCE
function my_mce_buttons_2( $buttons ) {
    array_unshift( $buttons, 'styleselect' );
    return $buttons;
// Register our callback to the appropriate filter
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );

Which I found from the codex on TinyMCE Custom Styles. But that adds 700 new options (Inline, Blocks, Alignment):

TinyMCE - Headings Inline Blocks Alignment

... And I'm just after added those two paragraph-styles to the existing options.

I can find many guides on how to add a new button to the TinyMCE, - but nothing on added new lines in that dropdown there.

I might just struggle to describe this properly, - but I can't find anything on Google about this.

Your Answer

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

Browse other questions tagged or ask your own question.