Advertisement
Guest User

Untitled

a guest
Sep 11th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.45 KB | None | 0 0
  1. <div id="tabCat">
  2.             <!-- DISPLAY ALL KNOWLEDGE BASE POSTS, GROUP BY SECTION TAXONOMY -->
  3.             <?php
  4.             $categories = get_terms('section', 'orderby=name&order=DESC&hide_empty=1&exclude=60,59');
  5.             foreach( $categories as $category ):
  6.                 ?>
  7.             <h3 class="kb-cat-title"><?php echo $category->name; // Prints the cat/taxonomy group title ?></h3>
  8.             <div class="kb-single-border"></div>
  9.             <?php
  10.             $posts = get_posts(array(
  11.                 'post_type' => 'knowledgebase',
  12.                 'showposts' => 5,
  13.                 'taxonomy' => $category->taxonomy,
  14.                 'term' => $category->slug,
  15.                 'perm' => 'readable'
  16.                 ));
  17.             $count = 0;
  18.             foreach($posts as $post): ?>
  19.  
  20.      <?php setup_postdata($post); //enables the_title(), the_content(), etc. without specifying a post ID
  21.      
  22.      
  23.  
  24.      if ($count == 0) { ?>
  25.      <div class="kb-home-big">
  26.         <?php if (has_post_thumbnail() ) {
  27.             the_post_thumbnail('kb-home-thumb', array('class' => 'kb-home-thumb-small kb-big kbImgFix'));
  28.         }?>
  29.         <h2 class="kb-home-list-rt-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
  30.         <span class="theExcerpt"><?php echo excerpt(25);?>... <br/>
  31.         <a class="link" href="<?php the_permalink();?>">Read More</a>
  32.      </span>
  33.        
  34.      </div>
  35.      <?php } else { ?>
  36.      <div class="kb-home-list">
  37.         <h2 class="kb-home-list-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
  38.      </div>
  39.  
  40.      <?php } ?>
  41.      <?php $count ++;  endforeach; ?>
  42.      <div class="clear"></div>
  43.     <?php endforeach; ?>
  44. </div>
  45.  
  46.  
  47.  
  48. <div id="tabRecent">
  49.     <!-- DISPLAY ALL KNOWLEDGE BASE POSTS, BY DATE OFFSET FIRST 7 DISPLAYED IN MULTI-COLUMN LAYOUT -->
  50.     <ul class="post-list">
  51.         <?php query_posts('post_type=knowledgebase&posts_per_page=10&offset=7&orderby=date&perm=readable'); ?>
  52.         <?php while (have_posts()) : the_post(); ?>
  53.            
  54.         <li>
  55.             <div class="post-list-item" style="">
  56.                 <?php if (has_post_thumbnail() ) {
  57.                     the_post_thumbnail('kb-home-thumb', array('class' => 'kb-home-thumb-small'));
  58.                 }?>
  59.                 <span class="theDate paddingCorr">
  60.                     <?php the_time('F j, Y');?>
  61.                 </span>
  62.                 <div class="details">
  63.                     <?php echo my_get_the_term_list( $post->ID, 'section',  '', ', ', '', array(60) ); ?>
  64.                 </div>
  65.                 <h2 class="kb-home-list-title-noborder"><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
  66.                 <div class="theExcerpt">
  67.                     <?php echo excerpt(25);?>...
  68.                 </div>
  69.                 <a class="link" href="<?php the_permalink();?>">Read More</a>
  70.             </div>
  71.         </li>
  72.     <?php endwhile;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement