Wordpress: showing posts of subcategories
<p>I searched a lot for this but couldn't find a working solution for my exact problem.</p>
<p>What I am looking for is:</p>
<blockquote>
<p><strong>On category parent page:</strong></p>
<p>Child category title I</p>
<blockquote>
<p>Display X posts of subcategory</p>
</blockquote>
<p>Child category title II</p>
<blockquote>
<p>Display X posts of subcategory</p>
</blockquote>
<p>Posts with no subcategory selected, but do have the parent</p>
<blockquote>
<p>Display all other posts of parent category</p>
</blockquote>
<p>etc..</p>
</blockquote>
<p>And then for</p>
<blockquote>
<p><strong>On category child page:</strong></p>
<p>Display all posts</p>
</blockquote>
<p>I am looking for a solution I can write within the loop like this:</p>
<pre class="lang-php prettyprint-override"><code>&lt;?php the_title(); ?&gt;
</code></pre>
<p>etc. (I hope everyone understands what I mean).</p>
<p>I am really thankful if some one helps me out, it's even better if it's with a little bit explanation of the result!</p>