Advertisement
Guest User

Untitled

a guest
Dec 7th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $cat = 'gift';
  5. $catID = get_cat_ID($cat);
  6. $subcats = get_categories('child_of=' . $catID);
  7.  
  8. foreach($subcats as $subcat)
  9.  
  10. {
  11. echo '<div class="giftrow">';
  12. echo '<h1>' . $subcat->cat_name . '</h1>';
  13. echo '<div class="gift">';
  14. echo '<ul>';
  15.  
  16. $subcat_posts = get_posts('cat=' . $subcat->cat_ID);
  17.  
  18. foreach($subcat_posts as $subcat_post)
  19.  
  20. {
  21.  
  22. echo '<li>';
  23. echo '<img src="' . the_post_thumbnail($postID) .'" />';
  24. echo '<div class="gift_desc">';
  25. echo '<h6>' . get_the_title($postID) . '</h6>';
  26. $postID = $subcat_post->ID;
  27. echo '<a href="' . get_permalink($postID) . '">';
  28. echo 'View details';
  29. echo '</a>';
  30. echo '</div>';
  31. echo '</li>';
  32.  
  33. }
  34.  
  35. echo '</ul>';
  36. echo '</div>';
  37. echo '</div>';
  38. }
  39.  
  40. ?>
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement