Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LeRah

    (@lerah)

    nvm i got it working with this code:

    <?php
    	$categories = get_categories('child_of=2');
    
    	foreach ($categories as $cat) {
    		echo "<h3>" . $cat->name . "</h3>";
    
    		query_posts('cat=' . $cat->term_id);
    
    		while (have_posts()) : the_post();
    			?>
    			<a href="<? the_permalink(); ?>" title="<? the_title(); ?>"><? the_title(); ?></a><br />
    			<?php
    		endwhile;
    	};
    ?>

    but when i change the while loop to only show 5 posts it shows the parent category’s name instead :S

    is there a better way of doing this??

    Thread Starter LeRah

    (@lerah)

    thanks i’ll check them out, but im no php expert so more help is appreciated.

    using the twentytwelve theme

Viewing 2 replies - 1 through 2 (of 2 total)