valaryu
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Fixing WordPress
In reply to: Problem with WooThemes Original Premium News Imagesi think i’ve found a not-so-cool solution but it works for me..
you just have to go to feature.php, when you open it scroll down to the
bottom where you’ll see the ‘if’ condition to display the image specified in the custom field..you just have to comment the li code where the custom field has not been completed .. and copy and paste the li code where the if condition is evaluated to true
<?php if ( get_post_meta($post->ID, 'image', true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD --> <!-- copy this line --> <li <?php if ($counter == 5) { ?>class="last"<?php } ?>><a href="#post-<?php the_ID(); ?>"> <!-- copy this line --> <?php woo_image('height=57&width=100&link=img'); ?> </a></li> <?php } else { ?> <!-- DISPLAY THE DEFAULT IMAGE, IF CUSTOM FIELD HAS NOT BEEN COMPLETED --> <!-- comment this line --> <!--<li <?php if ($counter == 5) { ?>class="last"<?php } ?>><a href="#post-<?php the_ID(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/no-img-thumb.jpg" alt=""/></a></li> --> <!-- paste it here --> <li <?php if ($counter == 5) { ?>class="last"<?php } ?>><a href="#post-<?php the_ID(); ?>"> <!-- paste it here --> <?php woo_image('height=57&width=100&link=img'); ?>
the only drawback is that it uses the first image inserted in the post [0]
Viewing 1 replies (of 1 total)