WordPress.org

Ready to get started?Download WordPress

Forums

How to display a category in a page? (2 posts)

  1. 3eamus
    Member
    Posted 6 years ago #

    I want to display a Category in a "Page" because I have a Contests page and want to just display all the Contest entries in it. I created a Contest Page and put what I thought was the right code in there:

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

    But it's not displaying anything. Am I right to create a new Page to display a category for a "Contest" page?

    thanks,
    shane

  2. moshu
    Member
    Posted 6 years ago #

    No, you are wrong.
    Use Category_Templates for displaying posts in a category.

Topic Closed

This topic has been closed to new replies.

About this Topic