September 15, 20169 yr Hi have a shortcode that looks like this [column][/column] Trying to add a class to a column like this: [column class=orange-row-full][/column] Does not work.......Is this achievable?
September 16, 20169 yr No, it's not achievable. You can add attributes to shortcodes but they need to be defined in the shortcodes properties. https://codex.wordpress.org/Shortcode_API
September 16, 20169 yr You'll need to edit your functions.php (or the file where your column shortcodes are defined). Here's an example of one of my simpler shortcode functions: function cryst4l_box( $atts, $content = null ) {extract( shortcode_atts( array( 'class' => '', ), $atts ) ); return '<div class="u-box '.$class.'">' . do_shortcode($content) . '</div>';}add_shortcode('box', 'cryst4l_box'); You could add the highlighted parts to your function, or copy / paste it here and we'll be able to help. Edited September 16, 20169 yr by teodora Formatting
Create an account or sign in to comment