Include the featured image in the post

Alright, I tried to get that to work but I was thrown a PHP error. (unexpected < somewhere). I was able to add your other suggestion perfectly fine, Clearing the text from the shortcode, but not when including the featured image. I imagine I’m copy+pasting too many things or the wrong things into my function.php file. I’m honestly confused with the majority of the following paragraph:

This can be done in a custom template by copy and pasting the publish_format_html() function from it’s github, renaming the function by adding a namespace, adding the {featuredimage} template tag, removing the call to apply_filters from the function’s return statement, and then hooking into the new function. Note: you also need to remove the self::get_text_options() statement from the original function.

And then additionally confused by the code you’ve added following it.

My function.php file is super simple at the moment:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 15 );
function theme_enqueue_styles() {
    wp_enqueue_style( 'youplay-child', get_stylesheet_directory_uri() . '/style.css' );
}

add_filter( 'wp_discourse_excerpt', 'my_namespace_fix_shortcodes' );

function my_namespace_fix_shortcodes( $excerpt ) {
    $excerpt     = str_replace( '[nk_title]', '<h2>', $excerpt );
    $excerpt     = str_replace( '[/nk_title]', '</h2>', $excerpt ); 
    $excerpt     = str_replace( '[yp_text]', '<p>', $excerpt );
    $excerpt     = str_replace( '[/yp_text]', '</p>', $excerpt );

    $excerpt     = preg_replace('(\\[([^[]|)*])', '', $excerpt );

    return $excerpt;
}

Sorry for my confusion, but do you have an guidance on this?