Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $categories = get_the_category();
- $catID = $categories[0]->cat_ID;
- ?>
- <?php
- $subcats = get_categories('child_of=' . $catID);
- foreach($subcats as $subcat) {
- echo '<h3>' . $subcat->cat_name . '</h3>';
- echo '<h2>'. $subcat->cat_name.'</h2>';
- print_r($subcat);
- echo '<ul>';
- $subcat_posts = get_posts('cat=' . $subcat->cat_ID);
- foreach($subcat_posts as $subcat_post) {
- print_r($subcat_post);
- $postID = $subcat_post->ID;
- echo '<li>';
- echo '<a href="' . get_permalink($postID) . '">';
- echo get_the_title($postID);
- echo '</a></li>';
- }
- echo '</ul>';
- } ?>
- <?php
- wp_list_categories( array(
- 'orderby' => 'id',
- 'current_category' => '1',
- 'show_count' => false,
- 'use_desc_for_title' => false,
- 'hide_empty' => 0,
- 'title_li' => __("Color:"),
- 'child_of' => 46
- ) );
- ?>
- <?php
- wp_list_categories( array(
- 'orderby' => 'id',
- 'show_count' => false,
- 'use_desc_for_title' => false,
- 'title_li' => __("Design:"),
- 'child_of' => 48
- ) );
- ?>
- <?php
- wp_list_categories( array(
- 'orderby' => 'id',
- 'show_count' => false,
- 'use_desc_for_title' => false,
- 'title_li' => __("SERIES:"),
- 'child_of' => 43
- ) );
- ?>
- <?php
- $categories = get_the_category();
- $catID = $categories[0]->cat_ID;
- $subcats = get_categories('child_of=' . $catID);
- foreach($subcats as $subcat) {
- echo '<h3>' . $subcat->cat_name . '</h3>';
- echo '<h2>'. $subcat->parent_name.'</h2>';
- }
- ?>
Add Comment
Please, Sign In to add comment