Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cat = 'gift';
- $catID = get_cat_ID($cat);
- $subcats = get_categories('child_of=' . $catID);
- foreach($subcats as $subcat)
- {
- echo '<div class="giftrow">';
- echo '<h1>' . $subcat->cat_name . '</h1>';
- echo '<div class="gift">';
- echo '<ul>';
- $subcat_posts = get_posts('cat=' . $subcat->cat_ID);
- foreach($subcat_posts as $subcat_post)
- {
- echo '<li>';
- echo '<img src="' . the_post_thumbnail($postID) .'" />';
- echo '<div class="gift_desc">';
- echo '<h6>' . get_the_title($postID) . '</h6>';
- $postID = $subcat_post->ID;
- echo '<a href="' . get_permalink($postID) . '">';
- echo 'View details';
- echo '</a>';
- echo '</div>';
- echo '</li>';
- }
- echo '</ul>';
- echo '</div>';
- echo '</div>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement