Guest User

Untitled

a guest
Jan 6th, 2013
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base);
  2.         if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
  3.             $number = 10;
  4.            
  5.         $cat_link_title = '<a href="#">'.$title.'</a>';
  6.  
  7.         $r = new WP_Query(array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'cat' => $instance['cat']));
  8.         if ($r->have_posts()) :
  9. ?>
  10.         <?php echo $before_widget; ?>
  11.         <?php if ( $title ) echo $before_title . $cat_link_title . $after_title; ?>
  12.         <?php  while ($r->have_posts()) : $r->the_post(); ?>
  13.             <div class="blog-list-row">
  14.             <div class="home-thumb">
  15.                 <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'homepage-thumb-74' ); } ?></a>
  16.             </div>
  17.                 <h3 class="post-list">
  18.                 <a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a>
  19.                 </h3>
  20.                 <p>
  21.                 <?php $excerpt = get_the_excerpt();
  22.                 echo string_limit_words($excerpt,8); ?>
  23.                 </p>
  24.             </div>
  25.         <?php endwhile; ?>
  26.  
  27.         <?php echo $after_widget; ?>
RAW Paste Data