WordPress.org

Ready to get started?Download WordPress

Forums

Problem with the loop (3 posts)

  1. alexborras
    Member
    Posted 4 years ago #

    I am using this code to see a list of post titles:

    query_posts("cat=7&showposts=10");
    ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    <?php endwhile;?>
    </ul>
    <?php

    the result is correct:
    * Post 1
    * Post 2
    * ...
    but after seeing the list is again the full content of the Post:
    Post 1
    Text of Post 1 ...
    Post 2
    Text of Post 2 ...

    Is there a way to view only the list of the titles of the Post?

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    If you're seeing content it's not the result of the code you have above, there's nothing in that code that would output the post content.

  3. alexborras
    Member
    Posted 4 years ago #

    OK, thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags