Skip to content

Instantly share code, notes, and snippets.

@rajvanshipradeep15
Created May 22, 2013 10:49
Show Gist options
  • Save rajvanshipradeep15/5626724 to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/5626724 to your computer and use it in GitHub Desktop.
wordpress: using timthumb example
<div class="span3 " id="<?php echo $post->ID; ?>">
<div class="" style="margin-left:0px;">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="postimg" id="img_<?php echo $post->ID; ?>">
<?php
if(has_post_thumbnail()) { ?>
<?php //echo get_the_post_thumbnail($post->ID, array(255,90)); ?>
<img src="<?php bloginfo('template_directory'); ?>/wp-content/themes/mytheme1/timthumb.php?src=<?php echo get_image_url(); ?>&amp;h=90&amp;w=255&amp;zc=1" alt="<?php the_title(); ?>"/>
<?php } else {
echo '<img src="'.get_bloginfo("template_url").'/images/nothumb.jpg" alt="No Thumbnail"/>';
}?>
</div>
<div class="" id="content_<?php echo $post->ID ?>">
<?php echo truncateWords($post->post_content)."..."; ?>
</div>
</div><!--span12-->
</div><!--span4-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment