Hello,
I’ve found this little piece of code and it’s exactly what I was looking for.
Now, can anyone help me to get the titles of the posts as links
and
to order the posts and subcategory titles as it is usually possible with posts.
I tried but I’m not so good in coding ...
Here I’ve found the code:
http://codex.wordpress.org/User:Siddharta1337/subcategoriespostsList
and that’s the code:
<ul>
<?php
$categories= get_categories('child_of=6'); /// Parent Category number
//echo count($categories) . "<br />";
foreach ($categories as $cat) {
$var = $cat->cat_ID ;
$lastposts = get_posts('category='.$var);
echo "<h1>".$cat->cat_name. " (" .count($lastposts)." posts )</h1>";
echo "<ul>";
foreach($lastposts as $post){
setup_postdata($post);
echo "<li>";
the_title();
echo "</li>";
}
echo "</ul>";
}
?>
</ul>
Viktor