• I am looking for help/advice for two questions.

    1. How to show on category list only posts that assigned to that particular category. Usually when you click category link it show posts from all sub-categories as well.

    For example: top-level category movies, will show ALL movies from sub-categories like horror, comedy, drama, etc in order it was posted.

    Sub-category “horror” divided for years like sub-categories 1940, 1950 but on list it will show all years that in sub-categories.
    Is it possible to exclude sub-categories from being show in top-level?

    2. Settings for how many posts shows on one category page are standard and working same for all categories.
    Is it possible to specify how many posts show in particular category?

    I think those questions are important when using WP as CMS. For instance – I need in top category only one post with introduction article, all other post are in sub-categories.

    Any help and advices appreciated!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter xrundel1

    (@xrundel1)

    Nobody? ??

    Thread Starter xrundel1

    (@xrundel1)

    Sorry for keeping it up, but I really, really need solution…

    Hi

    Hope this helps, you can display content from only the parent category without displaying other subcategory content or posts belonging to them by doing this;

    <?php while (have_posts()) : the_post(); ?>
    <? if ((is_category()) && in_category($wp_query->get_queried_object_id())) { ?>

    <?php endwhile; ?>
    ?<?php } ?>
    ?
    Let us know if that works for you.

    Oops…

    <?php while (have_posts()) : the_post(); ?>
    <? if ((is_category()) & in_category($wp_query->get_queried_object_id())) { ?>

    <?php } ?>
    <?php endwhile; ?>
    ?

    I think those questions are important when using WP as CMS.

    You need to work on your theme category.php to achieve desire result. its required knowledge of php loop and understanding of WordPress Framework. This is a core framework and you need to code your theme in such way that you can modify as per your need.

    KentonWebDesign is given you a example how to do that.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to play with categories?’ is closed to new replies.