Hallo zusammen,
ich habe mir ein eigenes Bootstrap Theme gebaut und möchte im Editor Shortcodes verwenden. Ich habe mir unter anderem ein Carousel Template gebaut und möchte die Inhalte innerhalb eines jeden Slides mit Spalten versehen. Idealerweise soll das so aussehen:
Code
...
[item_active]
[col-md-12]
col-12
[/col-md-12]
[/item_active]
[item]
[col-md-6]
col-6
[/col-md-6]
[col-md-6]
col-6
[/col-md-6]
[/item]
...
Alles anzeigen
Die functions.php:
PHP
...
function shortcode_item_active( $atts, $content=null ) {
return '<div class="item active"><div class="container"><div class="row">'. do_shortcode($content) . '</div></div></div>';
}
add_shortcode( 'item_active', 'shortcode_item_active' );
function shortcode_item( $atts, $content=null ) {
return '<div class="item"><div class="container"><div class="row">'. do_shortcode($content) . '</div></div></div>';
}
add_shortcode( 'item', 'shortcode_item' );
function shortcode_col_md_12( $atts, $content="" ) {
return '<div class="col-md-12">'. do_shortcode($content) . '</div>';
}
add_shortcode( 'col_md_12', 'shortcode_col_md_12' );
remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
...
Alles anzeigen
Wenn ich die Seite ansehe, dann wird z.B. die col-md-12 nicht umgewandelt. Woran liegt das. Auf einer anderen Seite konnte ich zum Beispiel das Kontaktformular ohne Schwierigkeiten "nesten".