Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 12th, 2012  |  syntax: None  |  size: 1.50 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2.  
  3.     <?php
  4.     $category = get_the_category();
  5.     $current_category = $category[0]->term_id;
  6.     $qarr = array(
  7.         'posts_per_page' => $posts_number,
  8.         'cat' => $current_category,
  9.         'tag' => 'pinned', // this is the tag that it filters
  10.         'post__not_in' => array(get_the_ID())
  11.     );
  12.     $q = new WP_Query($qarr);
  13.     if($q->have_posts()) : while ($q->have_posts()) : $q->the_post();
  14.     ?>
  15.         <div class="block-post clearfix">
  16.             <?php
  17.                 $thumb = '';
  18.                 $width = 287;
  19.                 $height = 162;
  20.                 $classtext = 'post-image';
  21.                 $titletext = get_the_title();
  22.                 $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Recent');
  23.                 $thumb = $thumbnail["thumb"];
  24.             ?>
  25.    
  26.             <?php if($thumb <> '' && get_option('aggregate_thumbnails_index') == 'on') { ?>
  27.                 <div class="thumb">
  28.                     <a href="<?php the_permalink(); ?>">
  29.                         <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
  30.                         <span class="overlaybig"></span>
  31.                     </a>
  32.                 </div>  <!-- end .post-thumbnail -->
  33.             <?php } ?>
  34.    
  35.             <div class="recenttitle"><h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3></div>
  36.         </div> <!-- end .block-post -->
  37.     <?php endwhile; endif;?>