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 17th, 2011  |  syntax: None  |  size: 1.43 KB  |  views: 53  |  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. <?php if (has_post_thumbnail()||is_search()) { $singleclass="singlepost"; }
  2.         else { $singleclass = "pagepost"; } ?>
  3. <?php if (is_home()) { $singleclass=" "; } ?>
  4.     <aside id="sidebar" class="<?php echo $singleclass; ?>">
  5.    
  6.    
  7.     <?php query_posts( 'cat=5&showposts=2' ); ?>
  8.         <?php if (have_posts()) : ?>
  9.            
  10.         <?php while (have_posts()) : the_post(); ?>
  11.    
  12.     <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'sidebar-thumbnail', flase ); ?>
  13.     <!-- { the_post_thumbnail( ''post-thumbnail' , false' );   -->          
  14.     <article id="post-<?php the_ID(); ?>" >
  15.        
  16.         <div class="advert" style="background: url(<?php echo $src[0]; ?> ) top left no-repeat;">
  17.             <div class="copy">
  18.             <h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
  19.        
  20.                 <?php the_excerpt(); ?>
  21.        
  22.                 </div>
  23.         </div>
  24.         </article>
  25.    
  26.  
  27.         <?php endwhile; ?>
  28.    
  29.    
  30.         <?php else : ?>
  31.      
  32.         <section id="no-results">
  33.                 <h2>Oh no, there&rsquo;s nothing here.</h2>
  34.                 <p>Maybe a search will find what you&rsquo;re looking for.</p>
  35.                 <?php include (TEMPLATEPATH . '/searchform.php'); ?>
  36.         </section>
  37.      
  38.         <?php endif; ?>
  39. <!-- extra stuff -->
  40.         <ul id="sidebar">
  41.         <?php if ( !function_exists('dynamic_sidebar')
  42.         || !dynamic_sidebar() ) : ?>
  43.         <?php endif; ?>
  44.     </ul>
  45. </aside>