0

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.

1

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
} ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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