Please take some time to read the Codex. the_ID
echo
s content. That means that the ID is never being passed to get_post_meta
. It is just echo
ed in place. From the same Codex Page:
Note: This function displays the ID of the post, to return the ID use
get_the_ID().
So, use get_the_ID
instead.
Second problem… quote your string. As you have it written PHP will try, and likely fail, to find a constant named newtheme_section_id
. I don’t think that is intended.
$meta_values = get_post_meta( get_the_ID(), 'newtheme_section_id' );
If that code is in the Loop, it should work.