Advertisement
alchymyth

loop

Mar 31st, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php $date = '';
  2. if( have_posts() ) : while( have_posts() ) : the_post();
  3.     if( $date != get_the_date() ) {
  4.         $date = get_the_date(); ?>
  5.         <h3 class="news-date">Nieuws van <?php echo get_the_date('l j F Y'); ?></h3>
  6.     <?php } ?>
  7.     <span class="post-category">
  8.     <?php foreach( get_the_category() as $cat ) {
  9.         if( in_array($cat->name,array('WII U','3DS','DS','WII')) ) echo '<a href="' . get_category_link($cat->term_id) . '">' . $cat->name . '</a> '; //to restrict only to console categories - add all names into array - case sensitive
  10.     } ?>
  11.     </span>
  12.     <span class="post-title">
  13.     <a href="<?php the_permalink(); ?>" title="link to full post <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
  14.     </span>
  15.     <br/>
  16. <?php endwhile;
  17. else: echo 'no posts';
  18. endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement