WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a site and installed the More Fields plugin option to create custom fields in the posts.

I'll have an area for downloads, which will provide Word and Excel files to download.

If I create a field of type yes / no, as I call the code so that "If you marked YES" shows the image, and if you have marked as NO, hides the image.

Can anyone help me?

thank you

share|improve this question

Add a new "more field" radio button. For its value use *Show, Hide. The asterisk defaults to "Show".


$value = get_post_meta($post->ID, 'my_image', true);

if ( $value == 'Show' ) {
    echo '<img src="myimage.jpg">';
share|improve this answer
That's right, it worked correctly. Only two details, I had to create a checkbox, radio button using it will not let me use values​​. Thank you very much. – user15269 Apr 28 '12 at 5:48
@user15269 Then please mark this as solution. This is the check mark on the left below the voting arrows. – kaiser Nov 4 '12 at 16:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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