how to call a posts thumbnail url in the head area?
-
i have read posts about grabbing the posts thumbnail url but am not sure how to do this in the header area with something like:
<?php if (in_category('5') ) { the_post(); rewind_posts(); echo '<meta property="text" content="' . wp_get_attachment_thumb_url(get_the_ID()) . '" />'; } ?>
but this is outputting a blank space where the thumbnail url should be.
can anyone tell me the correct code to grab the thumbnail url of the post being viewed?
thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘how to call a posts thumbnail url in the head area?’ is closed to new replies.