Show empty categories in wordpress ???

Discussion in 'WordPress' started by fuser00, Apr 18, 2009.

  1. #1
    Hi, i want to show empty categories in my wordpess blog.

    I googled a bit and got this code:

    <?php wp_list_cats('sort_column=name&hierarchical=1&optioncount=1&hide_empty=0'); ?>

    The thing is i tried it and still nothing

    Does anybody know how to show empty categories?

    Thanks, fuser
     
    fuser00, Apr 18, 2009 IP
  2. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #2
    THe easiest way, without doing any coding is to take a blog post, maybe the first one, and check off all the category boxes that you want to show up, and they will.

    Then add to them as you post content in them.
     
    hmansfield, Apr 18, 2009 IP
  3. fuser00

    fuser00 Well-Known Member

    Messages:
    1,212
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Lol i did a test post as a pre-launch so i will do that

    thanks!!!

    fuser
     
    fuser00, Apr 18, 2009 IP
  4. internetmarketingiq

    internetmarketingiq Well-Known Member

    Messages:
    3,552
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    165
    #4
    To extend on that idea you can make an "Empty" post. Essentially a post with a punctuation mark or a very short piece of text a message or something similar then assign it to the categories you want to appear. Then as you populate your blog all you have to do is go back and un select your placeholder post.
     
    internetmarketingiq, Apr 20, 2009 IP
  5. surfnearnzone

    surfnearnzone Well-Known Member

    Messages:
    1,492
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #5
    I know this thread is quite old but I too was looking for a solution to this problem. Wordpress has evolved over the ages and updated multiple times, below code works very well for current (wordpress 3.4.5) as well as recent versions.

    <?php

    function all_cates($args)

    {
    $args['hide_empty'] = 0;
    // you can override any other defaults here too

    return $args;

    }
    add_filter( 'widget_categories_args', 'all_cates' );

    ?>

    You can see it in action on koezine.com. right now it is in development so you might see changes to theme and other things even while you may be browsing the site.

    You need to put this code in category.php or function.php in your wordpress theme files (and not in the main wordpress files)
     
    surfnearnzone, Jun 21, 2012 IP
  6. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #6
    We are only on WordPress 3.4
     
    hmansfield, Jun 21, 2012 IP