WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Displaying Posts from Category on Page (3 posts)

  1. matthew5384@gmail.com
    Member
    Posted 5 years ago #

    I want to have a page that has a description at the top, and then all of the posts in a certain category underneath that description.

    If I go into the HTML in the editor and paste this code under my description,

    <?php query_posts('category_name=Staff Home'); ?>

    I know I can use the category templates to show all the posts in a certain category by using this

    http://website.com/?cat=3

    but how can I have a description that always stays above the posts (only for one category, not all)?

  2. iridiax
    Member
    Posted 5 years ago #

    Put this in your theme's category.php above the loop:

    <?php if (is_category('3')) { ?>
    <?php echo category_description(); ?>
    <?php } else { ?>
    <!-- Put something else or nothing here -->
    <?php } ?>
  3. tprod
    Member
    Posted 5 years ago #

    Do you have a solution in order to have a WYSIWYG editor in this category description ? A plugin exists but it's not compatible with the last version of WordPress (2.6.x) :(

    Any solution ?

Topic Closed

This topic has been closed to new replies.

About this Topic