Thank you alchymyth,
I managed to make it work as I wanted. Thank you again. Here is the code that works.
<?php
$parentCatName = single_cat_title(”,false);
$parentCatID = get_cat_ID($parentCatName);
$childCats = get_categories( ‘child_of=’.$parentCatID );
if(is_array($childCats)):
foreach($childCats as $child){ ?>
<h2><?php echo $child->name; ?></h2>
<?php query_posts(‘cat=’.$child->term_id);
while(have_posts()): the_post(); $do_not_duplicate = $post->ID; ?>
<!– POST CODE –>
<!– END POST CODE –>
<?php
endwhile;
wp_reset_query();
}
endif;
?>
Thanks again for helping me.
Best Regards,
Julian
thanks chinmoy29, logical it should work like this. No when I implement it in the category page I get the following error:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /***/***/public_html/***/wp-content/themes/k2/category.php on line 11
and on line 11 is the following code:\
$childCats = get_categories( ‘child_of’ => $parentCatID );