Skip to content

Instantly share code, notes, and snippets.

/sub.php
Created Apr 1, 2017

Embed
What would you like to do?
<?php
$sub_categories = get_categories("child_of=14&orderby=ID");
foreach ($sub_categories as $cat) { ?>
<div class="genre_subcat">
<?php query_posts("cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name"); ?>
<h2><?php single_cat_title(); ?></h2>
<small><?php echo category_description($cat->cat_ID); ?></small>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to
<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<p class="postdate"><?php the_time('F jS, Y') ?></p>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</div>
<?php }?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.