some advance help needed for : IF ELSE
-
Hi,
i try to do a code who print a default img (no-img.jpg) if the required one dont poste by user, and now i dont know wher i make a mistake, the code dont print the default img:<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php // if there's a img in my custom field if($value !== '') { ?> <img src="<?php $values = get_post_custom_values("my-img"); echo $values[0]; ?>"> <?php } // end if statement // if there's no img else { ?> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/no-img.jpg" /> <?php } ?> <?php endwhile; else: ?> <?php endif; ?>
thanks for any idea and help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘some advance help needed for : IF ELSE’ is closed to new replies.