Advertisement
cosmocanuck

Customize Category Content

Aug 25th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. /**
  3. * Category Page Template.
  4. *
  5. * @package Impressive
  6. * @author Adam Abrams <adamabrams@shaw.ca>
  7. */
  8.  
  9. //Add Post Class Filter
  10. add_filter('post_class', 'sf_post_class');
  11.  
  12. function sf_post_class($classes) {
  13.     global $wp_query;
  14.     $classes[] = 'one-third';
  15.     if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
  16.      $classes[] = 'first';
  17.     return $classes;
  18. }
  19.  
  20.  
  21. remove_action('genesis_loop','genesis_do_loop');
  22. add_action('genesis_loop','custom_loop');
  23.  
  24.  
  25. function custom_loop() {
  26. while(have_posts()) : the_post();
  27.     echo '<div class="loopthumbnail">'. the_post_thumbnail('thumbnail') .'</div>';
  28.     echo '<div class="loopdate">'. the_date() .'</div>';echo '<div class="looptitel"><a href="'.get_permalink().'">'.get_the_title().'</a></div>';
  29. endwhile;
  30. }
  31.  
  32. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement