I'm hoping someone can help me figure out what may be happening with some PHP errors. They read like this:
"Warning: Illegal string offset 'type' in /home/awh/public_html/wp-content/themes/Avada/shortcodes.php on line 440"
The 'guilty lines' are 440,445,448,453, I've marked the lines in the code below (hope that's ok?)
The website is www.advancewithhealth.com and the errors seem to be generated due to some errors in the slider PHP code (it's a family friend so I'm not sure what changes she may have accidentally). I've included the guilty lines below:
//////////////////////////////////////////////////////////////////
// Slide
//////////////////////////////////////////////////////////////////
add_shortcode('slide', 'shortcode_slide');
function shortcode_slide($atts, $content = null) {
$str = '';
if($atts['type'] == 'video') { // <-- 440
$str .= '<li class="video">';
} else {
$str .= '<li class="image">';
}
if($atts['link']): // <-- 445
$str .= '<a href="'.$atts['link'].'">';
endif;
if($atts['type'] == 'video') { // <-- 448
$str .= $content;
} else {
$str .= '<img src="'.$content.'" alt="" />';
}
if($atts['link']): // <-- 453
$str .= '</a>';
endif;
$str .= '</li>';
return $str;
}
Thanks in advance for any help!
Warmly, Carlo
shortcode_slidein this entire script. I see a calladd_shortcode. Did I miss the function call or is the OP's script incomplete?