Reinstate H1 in tinymce editor

Home Forums Icelander Reinstate H1 in tinymce editor

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #22119

    Reinstate H1 in tinymce editor


    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hello there,

    The parent theme inside class-visual-editor.php lines 371 to 375 removes obsolete tags. I.e. H1, which I need to reinstated (at least for posts and custom posts classic editor). Is there any way to do it via child theme?

    Best Regards

    Oliver Juhas

    Hi Simon,

    Please note that H1 is applied by theme on the main page/post title. It should never been used second time on any HTML page from accessibility point of view. If you need to style a text the same way as H1 tag, the theme provides predefined CSS classes you can use – the h1 class in this case (should be available via “Formats” dropdown button).

    But if you really need to reintroduce H1 in TinyMCE, this code in your child theme‘s functions.php file should do the trick:

    function child_theme_tinymce( $init ) {
    	$init['block_formats'] = 'Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Address=address;Preformatted=pre;Code=code';
    	return $init;
    add_filter( 'tiny_mce_before_init', 'child_theme_tinymce', 20 );

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.