WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Displaying Posts from Category on Page

[Resolved] Displaying Posts from Category on Page

  • 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)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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 } ?>

    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 ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Displaying Posts from Category on Page’ is closed to new replies.
Skip to toolbar