How to display additional data fields on a WP page?

Good morning. Hooked Metabox with additional fields to the posts on WP, the data are perfectly preserved and are in the database. But it is impossible to bring them on the page, put in this way:
<?php echo get_post_meta($post--->ID, 'mytyperem', true); ?>

Tried and true:
<?php echo get_post_meta( get_the_ID(), 'mytyperem', true); ?>

However, on the post editing page and in the database everything is saved. What could be the problem? Thanks in advance!
June 26th 19 at 14:19
1 answer
June 26th 19 at 14:21
Probably in the wrong definition of $post->ID. It often happens that the previous down cycles.
Try to get ID; ?> immediately before the conclusion of the meta fields and compare ID with the ID of the current post. Does. Because the above code you need to work safely.
Output, ID match. - Bethel.Kreiger49 commented on June 26th 19 at 14:24
Sorry, I'm stupid... was Working, not in that post the output looked :D - Bethel.Kreiger49 commented on June 26th 19 at 14:27

Find more questions by tags WordPressPHP