First off, you should know that get_post_meta()
doesn’t create any custom fields (or metadata), it only retrieves the custom field’s value. But the WordPress functions that do create custom fields (for posts) are add_post_meta()
and update_post_meta()
.
So that get_post_meta($post->ID, "mt_post_subtitle", true)
simply retrieves the value of the meta/field named mt_post_subtitle
for the post (referenced by that $post
) and as I mentioned in the comment, you could try renaming the ACF field from subtitle
to mt_post_subtitle
and the get_post_meta()
call in your single.php
(single post) template should continue to work normally.
Alternatively, you could’ve also used the ACF function for retrieving custom field’s value, which is get_field()
, but renaming the field name is an easier option in that no code changes needed. 🙂 But for reference, with get_field()
and without changing the ACF field name, you’d change that get_post_meta()
to get_field( 'subtitle', $post->ID )
.