Advertisement
Guest User

Untitled

a guest
Nov 15th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php // cycle through categories, print 1 post for each category
  2. $categories=get_categories('orderby=&order=ASC&'); $duplicates = array();
  3. foreach($categories as $category) {
  4. $posts=get_posts(array('numberposts' => 1, 'tag' => featured, 'post__not_in' => $duplicates, 'category__in' => array($category->term_id)));
  5.  
  6. foreach($posts as $post) {
  7. setup_postdata($post); $duplicates[] = $post->ID; ?>
  8.  
  9. <div class="type-post-date" id="post-<?php the_ID(); ?>" >
  10. <?php
  11. $the_cat = get_the_category();
  12. $category_link = get_category_link( $the_cat[0]->cat_ID );
  13. ?>
  14. <div class="cat_name"><a href="<?php echo $category_link; ?>"><?php
  15. $category = get_the_category();
  16. echo $category[0]->cat_name;
  17. ?></a></div>
  18. <div class="post-home">
  19. <h2><a href="<?php the_permalink(); ?>" title="<?php printf( __('See %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  20. <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(thumbnail_small); ?> </a>
  21.  
  22. <div class="date_idea_content">
  23. <?php the_excerpt(); ?>
  24. </div><!-- .entry-content -->
  25.  
  26. </div>
  27.  
  28. <div class="date_idea_content_foot">
  29. <?php
  30. $the_cat = get_the_category();
  31. $category_link = get_category_link( $the_cat[0]->cat_ID );
  32. ?>
  33. <div class="more_ideas"><a href="<?php echo $category_link; ?>">See More
  34. <?php
  35. $category = get_the_category();
  36. echo $category[0]->cat_name;
  37. ?></a></div>
  38. </div>
  39.  
  40. </div><!-- #post-<?php the_ID(); ?> -->
  41.  
  42. <?php
  43. } // foreach($posts
  44. } // foreach($categories
  45. ?>
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement