Ok guys... I'm sure this is going to be a really easy answer. I'm a complete noob at this.

I have a custom field that is supposed to return a link. For some reason, it just redirects me back to my site homepage. I'm really new to Wordpress so I'm not sure what's going on but I've scoured Google and this is what I've got:

 href="<?php get_post_meta(get_the_id(), 'ramco-videos-link', true);

Why won't it return the link in the custom field?

  • 2
    get_post_meta won't print anything. Use echo get_post_meta. Jun 5, 2014 at 17:10

2 Answers 2


get_post_meta() only returns the output, but does not print it. You have to use either echo or the_meta() to print the actual output.

 href="<?php echo get_post_meta(get_the_id(), 'ramco-videos-link', true);

Try this:

<?php echo get_post_meta($post->ID, 'ramco-videos-link', true); ?>

Make sure you have the closing PHP tag in there.

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.