Forums
Forums / Plugin: Pods - Custom Content Types and Fields / Output Yes/No meta value
(@dominichostettler)
4 years, 9 months ago
Desperately trying to find out how to display the post meta value of my Custom Post Type Field “kosten”. Which has the type “boolean” (Yes/No),
echo get_post_meta(get_the_ID(), 'kosten', true); does not work.
echo get_post_meta(get_the_ID(), 'kosten', true);
(@pdclark)
Boolean false gets converted to blank in PHP. Try:
echo ( get_post_meta( get_the_ID(), 'kosten', true ) ) ? 'True' : 'False';
That works! Great – Thanks a lot.
The topic ‘Output Yes/No meta value’ is closed to new replies.