Wordpress - Categories Section. Oh please help me !

Discussion in 'WordPress' started by noobie2shoes, May 22, 2007.

  1. #1
    On My CashCow Blog, I was wondering if it was pretty straight forward to do this to my category section.

    Change it from this:

    Categories

    * AdSense
    * Affiliate Marketing
    * eBay
    * Miscellaneous Bovine Materials
    * The Cow Pasture

    To This:

    Categories

    * AdSense (14)
    * Affiliate Marketing (3)
    * eBay (5)
    * Miscellaneous Bovine Materials (12)
    * The Cow Pasture (1)

    See how next to each category there is a number of post in that section ? Does anyone know how I can do this ?

    Thanks for any help ! :confused::confused::confused:
     
    noobie2shoes, May 22, 2007 IP
  2. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone have an idea of the code required ?
     
    noobie2shoes, May 23, 2007 IP
  3. shaneoj

    shaneoj Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try this..

    <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','',''); ?>
    Code (markup):
     
    shaneoj, May 23, 2007 IP
  4. mooiness

    mooiness Peon

    Messages:
    409
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try using the "Category Order" plugin from this page:
    http://www.coppit.org/code/ (near the bottom)

    It has an option regarding post counts.
     
    mooiness, May 23, 2007 IP
  5. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <?php wp_list_categories('orderby=id[B]&show_count=1[/B]
    &use_desc_for_title=0&child_of=3&title_li='); ?>
    Code (markup):
    you need the bit in bold (i.e &show_count=1)
     
    just-4-teens, May 23, 2007 IP
  6. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6

    Thanks j4t,

    Do you know which file to edit in WP

    cheers
     
    noobie2shoes, May 23, 2007 IP
  7. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #7
    it is most likely your sidebar.php in your themes folder.
     
    just-4-teens, May 24, 2007 IP
  8. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <div class="dbx-group" id="sidebar">

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    <!--sidebox start -->
    <div id="categories" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Categories'); ?></h3>
    <div class="dbx-content">
    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
    </ul>
    </div>
    </div>
    <!--sidebox end -->

    <!--sidebox start -->
    <div id="archives" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Archives'); ?></h3>
    <div class="dbx-content">
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </div>
    </div>
    <!--sidebox end -->

    <!--sidebox start -->
    <div id="links" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Links'); ?></h3>
    <div class="dbx-content">
    <ul>
    <?php get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); ?>
    </ul>
    </div>
    </div>
    <!--sidebox end -->

    <!--sidebox start -->
    <div id="meta" class="dbx-box">
    <h3 class="dbx-handle">Meta</h3>
    <div class="dbx-content">
    <ul>
    <li class="rss"><a href="<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a></li>
    <li class="rss"><a href="<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a></li>
    <li class="wordpress"><a href="http://www.wordpress.org" title="Powered by WordPress">WordPress</a></li>
    <li class="login"><?php wp_loginout(); ?></li>
    </ul>
    </div>
    </div>
    <!--sidebox end -->

    <?php endif; ?>

    </div><!--/sidebar -->

    Hmmm Sorry for the cut n paste but cant seem to find it. Anyone help ?

    I checked all the files in theme but couldnt track anything resmbling the code above.
     
    noobie2shoes, May 25, 2007 IP
  9. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #9
    just-4-teens, May 25, 2007 IP
  10. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thanks mate

    You are just too prompt ! !!

    cheers
     
    noobie2shoes, May 25, 2007 IP
  11. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I am stumped I cant get it working

    are you able to type the exact code for me to cut n paste. I have NFI. :eek:
     
    noobie2shoes, May 25, 2007 IP
  12. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #12
    replace
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
    PHP:
    with
    <?php wp_list_categories('orderby=id&show_count=1
    &use_desc_for_title=0&title_li='); ?>
    PHP:

    that should work

    if you wantthem ordered by name rather than id change orderby=id to orderby=name
     
    just-4-teens, May 25, 2007 IP
  13. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #13
    hmmm still no good....
     
    noobie2shoes, May 25, 2007 IP
  14. BLaZeR

    BLaZeR Peon

    Messages:
    1,567
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #14
    You use your theme editor in the wp admin panel and make sure to click sidebars to do what just4teens told you.
     
    BLaZeR, May 25, 2007 IP
  15. noobie2shoes

    noobie2shoes Peon

    Messages:
    704
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Hey Blazer,

    I know that part....I have done it correctly but doesnt work......

    <div class="dbx-group" id="sidebar">

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    <!--sidebox start -->
    <div id="categories" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Categories'); ?></h3>
    <div class="dbx-content">
    <ul>
    <?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&title_li='); ?>
    </ul>
    </div>
    </div>
    <!--sidebox end -->

    <!--sidebox start -->
    <div id="archives" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Archives'); ?></h3>
    <div class="dbx-content">
    <ul>
    <?php wp_get_archives('type=mo.............

    I am stumped......how does this code look to you guys ? Maybe I stuffed it.
     
    noobie2shoes, May 25, 2007 IP
  16. bujuk

    bujuk Active Member

    Messages:
    171
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #16
    stumble on the same issue. but I got it working except the number appear below the categories. any suggestion how correct this ?

    thanks

     
    bujuk, Sep 20, 2007 IP
  17. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #17
    change the width of your sidebar.
     
    just-4-teens, Sep 20, 2007 IP
  18. bujuk

    bujuk Active Member

    Messages:
    171
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #18
    Not sure about that. I believe space allocated is sufficient enough. I'm using "almost spring". here is the example.
    [​IMG]
     
    bujuk, Sep 21, 2007 IP
  19. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
  20. bujuk

    bujuk Active Member

    Messages:
    171
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #20
    dont know what happen. suddenly its appear ok after using shaneoj code and playing around with the template tag. thank you very much guys for your help. especially to just-4-teens and shaneoj.
     
    bujuk, Sep 26, 2007 IP