Skip to content

Instantly share code, notes, and snippets.

@Mamaduka
Created June 22, 2012 10:24
Show Gist options
  • Save Mamaduka/2971897 to your computer and use it in GitHub Desktop.
Save Mamaduka/2971897 to your computer and use it in GitHub Desktop.
Add excerpt and continue reading link to Woo - Tabs widget
<?php
function woo_widget_tabs_latest( $posts = 5, $size = 45 ) {
global $post;
$latest = get_posts( 'ignore_sticky_posts=1&numberposts='. $posts .'&orderby=post_date&order=desc' );
foreach($latest as $post) :
setup_postdata($post);
?>
<li class="fix">
<?php if ($size <> 0) woo_image( 'height='.$size.'&width='.$size.'&class=thumbnail&single=true' ); ?>
<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<span class="meta"><?php the_time( get_option( 'date_format' ) ); ?></span>
<?php the_excerpt(); ?>
<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php _e( 'Continue Reading...', 'woothemes' ) ?></a>
</li>
<?php endforeach; wp_reset_query();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment