Custom field with if/else
-
I have the following code, but it doesn’t seem to be working correctly:
<?php if( get_post_meta($post->ID, "Image", true) ): ?> <img src="<?php echo $Image; ?>"><br /> <P> <?php wswwpx_content_extract ( ' ', 45, 45 ); ?> <?php else: ?> <?php the_content(); ?> <?php endif; ?>It looks like it should work, but the image doesn’t show up, though the text from the extract does work.
The content does show up if there is no ‘Image’ custom field.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Custom field with if/else’ is closed to new replies.