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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.