如何在wordpress中显示自定义帖子字段值

问题描述:

I want to display the specific custom field values in my custom post,i have used this code within the loop but still its not working can you anyone explain what is the problem?

我想在自定义帖子中显示特定的自定义字段值,我在循环中使用了这段代码但仍然 它不起作用 你能解释一下这是什么问题吗? p> div>

Try this code:-

<?php echo get_post_meta(get_the_ID(),'price', true); ?> 

As described here, you should be able to do

get_post_meta(get_the_ID(),'something')