Hello,
I am far from experienced with PHP. I know how to cut and paste a little but thats about as far as it goes. I was wondering if somebody could help me out with the following;
On my blog I use a custom field called "Image" to add an image to the post and show it on top of the blog entry (on single.php). It's a rather big image (560x300). When I add a video to my post I would like that image not to show up. Basically, Im looking for a piece of code that can do the following:
IF the post contains the tag 'video' DO NOT show image on top of post.
From what I've read around these forums it seems difficult to do this based on a tag though, so I would also settle for the same code, based on a category instead of a tag.
IF the post is in category 'video' DO NOT show image on top of post.
This is what the coding on single.php looks like:
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2 class="title"><?php the_title(); ?></h2>
<div id="stats" class="clearfloat"><span class="left"> <!-- <?php _e('Geschreven door','arthemia');?> <?php the_author_posts_link(); ?> <?php _e('op','arthemia');?> --> <?php the_time(get_option('date_format')); ?> <?php the_time(); ?> <?php the_tags(' ', ' <b>x</b> '); ?></span><span class="right"><a href="#respond"><?php comments_number(__('0 Reacties','arthemia'), __('1 Reactie','arthemia'), __('% Reacties','arthemia') );?></a></span></div>
<div class="entry clear float">
<?php $values = get_post_custom_values("Image");
if (isset($values[0])) { ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=564&h=300&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="564px" height="300px" /></a></p>
<?php } ?>
Any help would be much appreciated!