Hallo!
Ich habe folgendes Problem: Ich möchte einen Custom Style für den WYSIWYG Editor im Wordpress Backend erstellen. Dieser Style soll eine beliebige Textpassage komplett umfassen und im Frontend so eine Art Info-Box (mit Hintergrundfarbe oder so) mit Headline, Text, Liste, etc. sein können.
Ich mach das akutell so, dass ich in der functions.php den Style anlege und einbinde:
[COLOR=#cc7833]function [/COLOR][COLOR=#ffc66d]my_mce_before_init_insert_formats[/COLOR]([COLOR=#9876aa]$init_array[/COLOR])
{
[COLOR=#d0d0ff]$style_formats [/COLOR][COLOR=#cc7833]= array[/COLOR](
[COLOR=#cc7833]array[/COLOR]([COLOR=#a5c261]'selector' [/COLOR][COLOR=#cc7833]=> [/COLOR][COLOR=#a5c261]'span, ul, li, h1, h2, h3, p, strong'[/COLOR], [COLOR=#a5c261]'title' [/COLOR][COLOR=#cc7833]=> [/COLOR][COLOR=#a5c261]'Factbox 100%'[/COLOR], [COLOR=#a5c261]'inline' [/COLOR][COLOR=#cc7833]=> [/COLOR][COLOR=#a5c261]'div'[/COLOR], [COLOR=#a5c261]'classes' [/COLOR][COLOR=#cc7833]=> [/COLOR][COLOR=#a5c261]'colored'[/COLOR], [COLOR=#a5c261]'exact'[/COLOR][COLOR=#cc7833]=>true [/COLOR], [COLOR=#a5c261]'wrapper' [/COLOR][COLOR=#cc7833]=> true[/COLOR]),
);
[COLOR=#9876aa]$init_array[/COLOR][[COLOR=#a5c261]'style_formats'[/COLOR]] [COLOR=#cc7833]= [/COLOR][COLOR=#6e9cbe]json_encode[/COLOR]([COLOR=#d0d0ff]$style_formats[/COLOR]);
[COLOR=#cc7833]return [/COLOR][COLOR=#9876aa]$init_array[/COLOR];
}
[COLOR=#ffc66d]add_filter[/COLOR]([COLOR=#a5c261]'tiny_mce_before_init'[/COLOR], [COLOR=#a5c261]'my_mce_before_init_insert_formats'[/COLOR]);
Alles anzeigen
Das Problem ist jetzt, dass sobald ich bspw. einen Zeilenumbruch nach eine Headline mache, die Box in zwei Teile geteilt wird.
Hoffe das soweit verständlich formuliert zu haben und würde mich über Tipps oder Hinweise freuen. DANKE!
lg,
Werner