Hello,
This is the solution that worked for me. As I say, it’s not really clean but it can do the trick.
add this to the bootstrap-shortcodes.php
function row_inner($atts, $content = null)
{
return '<div class="row">' . do_shortcode($content) . '</div>';
}
add_shortcode('row_inner', 'row_inner');
function bs_columninner( $atts, $content = null ) {
extract( shortcode_atts( array(
"lg" => false,
"md" => false,
"sm" => false,
"xs" => false,
"offset_lg" => false,
"offset_md" => false,
"offset_sm" => false,
"offset_xs" => false,
"pull_lg" => false,
"pull_md" => false,
"pull_sm" => false,
"pull_xs" => false,
"push_lg" => false,
"push_md" => false,
"push_sm" => false,
"push_xs" => false,
"xclass" => false,
"data" => false
), $atts ) );
$class = '';
$class .= ( $lg ) ? ' col-lg-' . $lg : '';
$class .= ( $md ) ? ' col-md-' . $md : '';
$class .= ( $sm ) ? ' col-sm-' . $sm : '';
$class .= ( $xs ) ? ' col-xs-' . $xs : '';
$class .= ( $offset_lg ) ? ' col-lg-offset-' . $offset_lg : '';
$class .= ( $offset_md ) ? ' col-md-offset-' . $offset_md : '';
$class .= ( $offset_sm ) ? ' col-sm-offset-' . $offset_sm : '';
$class .= ( $offset_xs ) ? ' col-xs-offset-' . $offset_xs : '';
$class .= ( $pull_lg ) ? ' col-lg-pull-' . $pull_lg : '';
$class .= ( $pull_md ) ? ' col-md-pull-' . $pull_md : '';
$class .= ( $pull_sm ) ? ' col-sm-pull-' . $pull_sm : '';
$class .= ( $pull_xs ) ? ' col-xs-pull-' . $pull_xs : '';
$class .= ( $push_lg ) ? ' col-lg-push-' . $push_lg : '';
$class .= ( $push_md ) ? ' col-md-push-' . $push_md : '';
$class .= ( $push_sm ) ? ' col-sm-push-' . $push_sm : '';
$class .= ( $push_xs ) ? ' col-xs-push-' . $push_xs : '';
$class .= ( $xclass ) ? ' ' . $xclass : '';
$data_props = $this->parse_data_attributes( $data );
return sprintf(
'<div class="%s"%s>%s</div>',
esc_attr( $class ),
( $data_props ) ? ' ' . $data_props : '',
do_shortcode( $content )
);
}
Don’t forget to add ‘columninner’ to the add_shortcode function at line 65.
function add_shortcodes() {
$shortcodes = array(
'alert',
'badge',
'breadcrumb',
'breadcrumb-item',
'button',
'button-group',
'button-toolbar',
'caret',
'carousel',
'carousel-item',
'code',
'collapse',
'collapsibles',
'column',
'columninner',
...
Then you just have to call [row_inner] and [columninner] everytime you want inner rows and cols ??