• We’re using Atahualpa as a theme. And I have a number of categories that I need to display in different ways. For example FAQ’s should have a listing with a link on the heading, but the actual body of the post should be on the same page below the list of links…

    In other words I (think) I need one loop to pull the articles and show me their permalinks, and another loop to pull just the body and maybe the title of the article but not link to it.

    This seems to do the first part, but the second one doesn’t really work. We’re trying to avoid hardcoding anything to the theme itself so thats why we’re using exec-php to try to run this. Any suggestions or advice, as well as help on getting this working would be appreciated.

      <?php
      global $post;
      $myposts = get_posts(‘category=80’);
      foreach($myposts as $post) :
      ?>

    • “><?php the_title(); ?>
    • <?php endforeach; ?>

    <?php
    global $post;
    $myposts = get_posts(‘category=80’);
    foreach($myposts as $post) :
    ?>
    “><?php the_content(‘more_link_text’, strip_teaser, ‘more_file’); ?>
    <?php endforeach; ?>

    The first part works but the second one doesn’t. Any ideas?

  • The topic ‘help with loop code inside of a post via exec-php’ is closed to new replies.