I'm new at WordPress and trying to figure out how to put my custom field within the post and not before or after the post. I'm using this piece of code:
<?php if ( get_post_meta($post->ID, 'music', true) ) : ?>
<p><strong>I am Currently Listening to:</strong> <em><?php $key="music"; echo get_post_meta($post->ID, $key, true);?></em></p>
<?php endif; ?>
and placing it just before or after While loop in single.php file. If I place code anywhere within While loop - I get this error
Parse error: syntax error, unexpected '<' in /public_html/wp-content/themes/twentyseventeen/single.php on line 36
In general, my custom field is working, just appearing too high or too low and not in a post. Thank You.