how to call a custom field in the head area?
-
hello,
i am trying to output the contents of a custom field (created through the More Field plugin) in the head area of my templates header.php with:
<?php if ( in_category('5') ) {echo '<meta property="text" content="' . get_post_meta(get_the_ID(), 'custom_field', true) . '" />';}?>
and it is currently outputting:
<meta property="text" content="" />
ie it is not grabbing the value in the ‘custom_field’.
can someone please tell me how i can successfully grab the value of that custom field?
thanks very much!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘how to call a custom field in the head area?’ is closed to new replies.