WordPress.org

Ready to get started?Download WordPress

Forums

Posts on Pages depending on categorys (2 posts)

  1. chyth
    Member
    Posted 4 years ago #

    Hello Community,
    I've searched a long time and didn't find the solution that fits for my problem.
    I want my users to post in a category called "reports" and then publish these postings on a page (not in the main timeline of my blog). Is there a possibility to do this?

    I've found a solution which uses the template of a page, but the posts appear in the timeline of my mainblog and there is no possibility to add pagination...

    Please help.

    David

  2. @mercime
    Volunteer Moderator
    Posted 4 years ago #

    The simplest thing would be to exclude that "reports" category from showing up in your "regular" blog.
    So in your index.php, just before the WP loop ( <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> )
    you place this code

    <?php query_posts($query_string . '&cat=-9'); ?>

    where the negative number 9 is the ID# of the "reports" category in your installation so that it won't show up in the regular post pages. You could also add the code I gave above to your archive.php so that the only way people can access those posts in "reports" category is via category template.

Topic Closed

This topic has been closed to new replies.

About this Topic