Get_post_meta() won’t return value

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="https://wordpress.stackexchange.com/questions/147699/<?php get_post_meta(get_the_id(),"ramco-videos-link', true);

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

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="https://wordpress.stackexchange.com/questions/147699/<?php echo get_post_meta(get_the_id(),"ramco-videos-link', true);

Leave a Comment