0

I have a custom field in my post called fb_name. I need to be able to get that field name outside of the loop in my sidebar. How can I accomplish this?

2 Answers 2

1

If it's a single post or page, you can just pass the global $post->ID:

echo get_post_meta($post->ID, 'fb_name', true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.