• Hello,

    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

      for the list. Can someone please help me get over this last hump?

    <?php
    if (843 == $post->post_parent) {
    global $post;
    $myposts = get_posts('numberposts=10&tag=medical&order=DESC');
    foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach;
    }
    ?>
  • The topic ‘Loop modification’ is closed to new replies.