I have a wordpress site and I am using a plugin that uses shortcode as a widget to pull recent blog posts. In the column I am getting an error that reads:
Warning: Illegal string offset 'title' in /home3/xxxxx/xxxx.com/wp-content/plugins/recent-blogs-shortcode/recent-blogs-shortcode.php on line 44
So the Title would be the blog post title, but I am just having trouble on how to fix it.
add_shortcode( 'recent-blogs', 'cp_sidebar_recent_blogs_shortcode');
function cp_sidebar_recent_blogs_shortcode( $atts, $content = null ) {
// shortcode_atts will only allow us to supply 1 default; for the horizontal layout submitted with no title, use a different default
$title_default = '';
if ($atts['title'] == 'Related Posts' && $atts['layout'] == 'horizontal' ) {
$title_default = 'Related Posts';
}
else {
$title_default = 'Recent Posts';
}