Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have my WordPress post format codes:

<?php
if ( has_post_format( 'image' )) {
  echo 'This is a image post';
} ?>

And my code to grab the first image from a post...

<a href="<?php the_permalink() ?>">
<?php $image = catch_that_image();
if( $image ) { ?>
<img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image; ?>&amp;h=240&amp;w=280" class="index" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
<?php } ?>
</a>

So how do I put the image which is grabbed into the first code?

Thanks for all the help guys and gals, I really do appreciate it.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

here:

<?php
if ( has_post_format( 'image' )) {
?>
   <a href="<?php the_permalink() ?>">
   <?php $image = catch_that_image();
   if( $image ) { ?>
      <img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image; ?>&amp;h=240&amp;w=280" class="index" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
   <?php } ?>
   </a>
<?php
} ?>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.