WordPress.org

Ready to get started?Download WordPress

Forums

Count posts in parent category (10 posts)

  1. Begin
    Member
    Posted 2 years ago #

    Hi!

    I was trying this code:

    <?php
    wp_list_categories('depth=1&show_count=1&include=17');
    ?>

    But it doesn't give the number (it shows (1)) and
    it also display's the name (link) of the category.

    Any suggestions ?

    Thank's anyway!

  2. Jonathan Dingman
    Member
    Posted 2 years ago #

    hmmm do you have an example URL of where you're doing this?

  3. Begin
    Member
    Posted 2 years ago #

    I don't use it right now because it doesn't work and the title
    that it adds is messing up the site design... :-(

  4. Jonathan Dingman
    Member
    Posted 2 years ago #

    What are you wanting to be displayed instead?

  5. Begin
    Member
    Posted 2 years ago #

    just "386".

    just the number of posts that i have under that parent category.

  6. Jonathan Dingman
    Member
    Posted 2 years ago #

  7. Begin
    Member
    Posted 2 years ago #

    Thank you very much!

    I tried the first one witch seems to be the simplest solution,
    but it doesn't show the total number of posts under that parent
    category (including the posts in the child categories), it only
    shows the of posts straight under that category.

    the solution is including changing the functions file
    witch makes problems with updating wordpress...

    The third one i actually didn't understand, it seems
    to talk about checking if a category is empty or not...?!

    Thank's!

  8. Jonathan Dingman
    Member
    Posted 2 years ago #

    You may need to do some custom coding to get it exactly how you want it.

  9. Begin
    Member
    Posted 2 years ago #

    Ya I tried some, but i'm not enough of a "pro" to get it right...

  10. alesub
    Member
    Posted 2 years ago #

    Try adding pad_counts = true to your category call, that should include the counts of the child categories to the parent category.

Topic Closed

This topic has been closed to new replies.

About this Topic