WordPress removing slashes from shortcode output
Here is the correct shortcode function function section_shortcode_func( $atts, $content = null ){ $atts = shortcode_atts( array( ‘bgimage’ => ” ), $atts); $bgimage = isset( $atts[‘bgimage’] ) ? $atts[‘bgimage’] : ”; ob_start(); echo “<div class=”section” style=”background-image: url($bgimage)”>”; return ob_get_clean(); } Now you can call it this way [section bgimage=”xxx.xxx/wp-content/uploads/2017/10/xxx.jpg”]