Forums

¿ Removing comments from list of posts? (2 posts)

  1. Paul Weber
    Member
    Posted 2 years ago #

    I'm using the following code in a post in order to retrieve a list of posts for a given category
    '<?php
    global $post;
    $myposts = get_posts('&category=5');
    foreach($myposts as $post) :
    ?>

  2. "><?php the_title(); ?>
  3. <?php endforeach; ?>
    '

    It works perfectly except for the fact that it also displays the full comments appended to each title. How can this be avoided?

    Thx

    Paul

  • esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Your code might be more understandable if you placed a copy in the WordPress pastebin.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags