• If you go to Gloves on Pacific4.com you can see there are sub-categories with a description followed by Product names.

    I am trying to convert this site to a wordpress template to set up and use WordPress as a CMS. I am using this code below to display the sub-categories and their descriptions. The only thing missing is pulling the product titles under the description.

    <?php
    		$categories = get_categories();
    		foreach ($categories as $cat) {
    			echo '<li class="'.$cat->slug.'">
    				<a href="'.get_category_link( $cat->cat_ID ).'/"><span>'.$cat->cat_name.'</span></a>
    				<p>'.category_description( $cat->cat_ID ).'</p>
    				</li>';
    		}
    	?>

    Any suggestions on how I can do the loop for each of the sub-categories?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Pulling Post title and links for subcategories’ is closed to new replies.