Yes, you can keep nesting shortcodes. Just keep using the do_shortcode()
until the deepest level is reached. https://codex.wordpress.org/Shortcode_API#Nested_Shortcodes
So you can do this,
[container]
[other_column class="extra-class"]
[content]
col 1
[/content]
[another]
col 1-2
[/another]
[/other_column]
[column]
[another]
col 2
[/another]
[/column]
[/container]
To achieve output like this,
<div class="container">
<div class="other-column extra-class">
<div class="content">
col 1
</div>
<div class="another">
col 1-2
</div>
</div>
<div class="column">
<div class="another">
col 2
</div>
</div>
</div>
Provided you have shortcode functions something like this. I threw in an attributes example, should you need them.
function container_shortcode($atts = array(), $content = null) {
return '<div class="container">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'container', 'container_shortcode' );
function column_shortcode($atts = array(), $content = null) {
return '<div class="column">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'column', 'column_shortcode' );
function other_column_shortcode($atts = array(), $content = null) {
$defaults = array(
'class' => '',
);
$atts = shortcode_atts( $defaults, $atts, 'other_column_shortcode' );
$class = (! empty($atts['class']) ) ? 'other-column ' . $atts['class'] : 'other-column';
return '<div class="' . esc_attr($class) . '">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'other_column', 'other_column_shortcode' );
function content_shortcode($atts = array(), $content=null) {
return '<div class="content">' . $content . '</div>';
}
add_shortcode( 'content', 'content_shortcode' );
function another_shortcode($atts = array(), $content=null) {
return '<div class="another">' . $content . '</div>';
}
add_shortcode( 'another', 'another_shortcode' );