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 Nov 8th, 2011  |  syntax: None  |  size: 1.91 KB  |  views: 19  |  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.     <article>
  2.         <aside>
  3.         <div class="col_2 last aside">
  4.  <?php if ( get_post_meta($post->ID, 'Benefit summary', true) ) {
  5.         echo '<p class="benefitsummary">';
  6.                 $values = get_post_custom_values("Benefit summary"); echo $values[0];
  7.         echo '</p>';
  8.           } ?>
  9. <?php
  10. //for use in the loop, list 3 post titles related to first tag on current post
  11. $tags = wp_get_post_tags($post->ID);
  12. if ($tags) {
  13.   $first_tag = $tags[0]->term_id;
  14.   $args=array(
  15.     'tag__in' => array($first_tag),
  16.     'post__not_in' => array($post->ID),
  17. 'post_type' => 'resources',
  18. 'resourcetype' => 'white-paper',
  19.     'showposts'=>1,
  20.     'caller_get_posts'=>1
  21.    );
  22.   $my_query = new WP_Query($args);
  23.   if( $my_query->have_posts() ) {
  24.     while ($my_query->have_posts()) : $my_query->the_post(); ?>
  25.  <p class="typetitle">White Paper</a></p>
  26.       <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>&nbsp;&raquo;</a></p>
  27.       <?php endwhile;
  28.   }
  29. wp_reset_query();  // Restore global post data stomped by the_post().
  30. }
  31. ?>
  32. <?php
  33. $tags = wp_get_post_tags($post->ID);
  34.         $taglist = '';
  35.         if ($tags) {
  36.                 foreach ($tags as $tag) {
  37.                 $taglist .= $tag->term_id . ',';
  38.         }
  39.           $args=array(
  40.             'tag__in' => array($first_tag),
  41.            'post__not_in' => array($post->ID),
  42.         'post_type' => 'resources',
  43.         'resourcetype' => 'case-study',
  44.            'showposts'=>1,
  45.            'caller_get_posts'=>1
  46.    );
  47.   $my_query = new WP_Query($args);
  48.   if( $my_query->have_posts() ) {
  49.     while ($my_query->have_posts()) : $my_query->the_post(); ?>
  50.  <p class="typetitle">Case Study</a></p>
  51.       <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>&nbsp;&raquo;</a></p>
  52.       <?php  endwhile;
  53.   }
  54. wp_reset_query();  // Restore global post data stomped by the_post().
  55. }
  56. ?>
  57.         </div>
  58.         </aside>
  59.     </article>
  60. <?php } ?>
  61.  
  62.  
clone this paste RAW Paste Data