This is an old version of this answer!
Return to the current answer<?php
if(is_page('Sports'))
{
$cat = 'Sports';
$catID = get_cat_ID($cat);
echo '<h2>' . $cat . '<h2>';
$subcats = get_categories('child_of=' + $catID);
foreach($subcats as $subcat)
{
echo '<h4><a href="' . get_category_link($subcat->cat_ID) . '">' . $subcat->cat_name . ' <span>view only ' . $subcat->cat_name . ' →</a></h4>';
echo '<ul>';
$subcat_posts = get_posts('cat=' + $subcat->cat_ID);
foreach($subcat_posts as $subcat_post)
{
echo '<li>';
$postID = $subcat_post->ID;
echo '<a href="' . get_permalink($postID) . '">';
echo get_the_title($postID);
echo '<span class="listing-entry organization">';
echo get_post_meta($postID, 'module', true)['organization'][0];
echo '</span><span class="read-more">(read more)</span>';
echo '</a>';
echo '</li>';
}
echo '</ul>';
}
}
?>Just change the line
$cat = 'Sports'; to change the category.If there are any errors, please contact me.
Utkarsh Kukreti | 12/28/09 at 8:22am




