WordPress post query <p>I am trying to show posts with the tag "medical" if they are a child of page 843, and so far, I have everything mostly working. I need to get some HTML within this if statement so that I can enclose it all in a div, and also to set an opening and closing ul for the list.</p> <p>Can someone please help me get over this last hump? I'm just not sure where to add the HTML.</p> <pre><code>&lt;?php if (843 == $post-&gt;post_parent) { global $post; $myposts = get_posts('numberposts=10&amp;tag=medical&amp;order=DESC'); foreach($myposts as $post) : ?&gt; &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php endforeach; } ?&gt; </code></pre>