Jump to content

Custom field value showing up in all posts


chea

Recommended Posts

Hey sup. I have a wordpress question.

 

I created a custom field in my edit page called "youtube". I posted the below code in single.php. The result is what I want, just a simple text link, but the link is showing up in all posts. Any idea on what I need to do to make it so the custom field only shows up in one post?

 

 

<a href="<?php echo get_post_meta($post->ID, 'youtube', true); ?>">Youtube</a></p>

Show us the code for get_post_meta (), any other related code, what you expected it to give, and what you got. Once you've done that, we will (hopefully) have enough information to be able to help you. Copy-paste the result from your code, and not just explain it with words. After all, the more detailed information we have the easier it'll be for us to see what the actual problem is, and thus help you.

 

PS: Please use the


tags around your code, as it helps make both your post and your code a lot easier to read. I would also recommend that you read this article, for future posts.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.