Shortcode only produces text “Array”
-
Hi,
I’m creating a shortcode to apply styles to a site. The attributes determine (amongst other) the background colour so the user can influence this. However the output only is “Array”. I think I’m doing something relatively simple wrong.
I’ve got the following code:
function column_left_func( $atts, $content = null ) { $colour = shortcode_atts( array( 'white' => '<div class="col left white">', 'yellow' => '<div class="col left yellow">', ), $atts ); return $colour . $content . '</div>'; } add_shortcode( 'column_left', 'column_left_func' );The shortcode I use is: [column_left colour=”white”]
On the website I only see “Array”. Not the content or divs from the code.
Somebody has a hint? I must be close?
Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Shortcode only produces text “Array”’ is closed to new replies.