Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1346565

    Hi, weird question.
    How can I add sup and sub buttons to format text in the editor ?
    I need to format text this way (for example):
    <sup>1</sup>

    I tried to add this function to my functions.php with non success….

    function enable_more_buttons($buttons) {
      $buttons[] = 'sub';
      $buttons[] = 'sup';
      return $buttons;
    }
    add_filter("mce_buttons_3", "enable_more_buttons");

    Is it not working because AVIA editor modded the default editor?
    Is there a solution?
    thanks

    • This topic was modified 2 years, 8 months ago by niguli.
    #1346630

    it worked with code:

    function my_mce_buttons_2( $buttons ) {	
    	/**
    	 * Add in a core button that's disabled by default
    	 */
    	$buttons[] = 'superscript';
    	$buttons[] = 'subscript';
    
    	return $buttons;
    }
    add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
    #1346720

    Hi,

    Glad to know that you have found a working solution. Thanks for sharing! Please feel free to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Add sup & sub button in WordPress Editor’ is closed to new replies.