Same problem … I think it is because Custom Post Widget doesn’t do an actual WP_Query to get the content for the widget. Rather, it retrieves the content and runs it through the filters and shortcodes, trying to mimic what the_content() does. However, some filters are specific to a post type (e.g., the events for All-in-One Event Calendar) and they are getting erroneously applied to the content_block content.
I have modified function widget in post-widget as shown below and it seems to be working for me in my particular case. ymmv…
function widget($args, $instance) {
extract($args);
$custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __('Find', 'custom-post-widget');
// Variables from the widget settings.
$show_custom_post_title = isset( $instance['show_custom_post_title'] ) ? $instance['show_custom_post_title'] : false;
$content_post = get_post($custom_post_id);
$content = $content_post->post_content;
/* NEW */
global $post;
$tmp = $post;
$args = array(
'p' => $custom_post_id,
'post_type' => 'content_block'
);
$the_query = new WP_Query( $args );
echo $before_widget;
while ( $the_query->have_posts() ) : $the_query->the_post();
if ($show_custom_post_title) {
echo $before_title . the_title() . $after_title;
}
the_content();
endwhile;
echo $after_widget;
$post = $tmp;
/* END NEW */
/* OLD */
/*
$content = apply_filters('the_content', $content);
echo $before_widget;
if ( $show_custom_post_title ) {
echo $before_title . $content_post->post_title . $after_title; // This is the line that displays the title (only if show title is set)
}
echo do_shortcode($content); // This is where the actual content of the custom post is being displayed
echo $after_widget;
*/
/* END OLD */
}
}