To modify the content of a post, you can use the_content
filter. You (probably) only want to add the post meta to the main query. If not, you can skip the is_main_query()
conditional. Then you can just get the post meta and format it how you see fit and append it to the content.
//* Add filter to the_content if we're in the main query
add_action( 'the_post', 'wpse_261935_the_post' );
function wpse_261935_the_post( $post ) {
if( is_main_query() ) {
add_filter( 'the_content', 'wpse_261935_the_content' );
}
}
function wpse_261935_the_content( $content ) {
//* Make sure to add and remove filter for each post
//* to make sure it's in the main query
remove_filter( 'the_content', 'wpse_261935_the_content' );
$wpse_261935_meta = get_post_meta( get_post()->ID, '_wpse_261935_post_meta_key', true );
$wpse_261935_content = wpse_261935_format_post_meta( $wpse_261935_meta );
return $wpse_261935_content . $content;
}
function wpse_261935_format_post_meta( $post_meta ) {
//* Format the post meta however you'd like
return $html;
}