I made a custom field! :-D but just one question..
-
So I ventured into the custom field function and it was easier than I thought!
I made a custom field to post an image in the sidebar of posts. I put this code in my sidebar
<img src="<?php echo get_post_meta($post->ID, 'side-image', true); ?>" #<?php the_ID(); ?>" />
It works but for example in a post/page where I don’t upload an image, I get the default image broken/unavailable icon.
Is there a code I can add to tell not to display anything if there is no input in the custom-field?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘I made a custom field! :-D but just one question..’ is closed to new replies.