Try $HTML
instead of $html
Linux based systems are case-sensitive …
function post_banner_shortcode($atts) {
$atts = shortcode_atts( array(
'id' => ''
), $atts );
$post_id = $atts['id'];
$HTML = '<div class="postbanner">';
$HTML .= '<div class="pb-thumb">' . get_the_post_thumbnail($post_id, 'medium') . '</div>';
$HTML .= '<div class="pb-ttl-txt">';
$HTML .= '<h4>' . get_the_title($post_id) . '</h4>';
$HTML .= '<p>' . get_the_excerpt($post_id) . '</p>';
$HTML .= '</div>';
$HTML .= '</div>';
return $HTML;
}
add_shortcode( 'postbanner', 'post_banner_shortcode' );