Thread Starter
Mary
(@marypop)
Earlier I have used this in functions.php:
// Customize the format dropdown items
if( !function_exists('base_custom_mce_format') ){
function base_custom_mce_format($init) {
// Add block format elements you want to show in dropdown
$init['theme_advanced_blockformats'] = 'p,h2,h3';
// Add elements not included in standard tinyMCE dropdown p,h1,h2,h3,h4,h5,h6
//$init['extended_valid_elements'] = 'code[*]';
return $init;
}
add_filter('tiny_mce_before_init', 'base_custom_mce_format' );
}
What can I do now to disable heading 1?
Thread Starter
Mary
(@marypop)
Thank for an answet.
Can you give me a hint were to place this piece of code?
I tried this in functions.php, but it’s not working at all:
function myformatTinyMCE($in)
{
$in['entity_encoding']= 'block_formats: "Paragraph=p;Header 2=h2;Header 3=h3"'; // numeric/raw
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
That’s not the right code (copy/paste error?). Perhaps try:
function myformatTinyMCE($in) {
$in['block_formats'] = "Paragraph=p;Header 2=h2;Header 3=h3";
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
Thread Starter
Mary
(@marypop)
Thanks Andrew, it worked perfectly! :)) Wow!