PHP call problem

Discussion in 'PHP' started by Cheap SEO Services, Nov 20, 2006.

  1. #1
    Hi,

    Just a simple one. I have this little bit of code in my wordpress sidebar:

    <ul>
    <?php wp_list_cats('sort_column=name'; 'optioncount=1'); ?>
    </ul>

    Obviously it is not working but I would like it to be....LOL

    It's to sort the category list and also count how many posts in each cat.

    Any help appreciated!!

    Thanks,

    Col :)
     
    Cheap SEO Services, Nov 20, 2006 IP
  2. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Umm, shouldn't it be a comma ',' instead of a semi-colon ';' separating the 2 parameters...?

    such as:

    <ul>
    <?php wp_list_cats('sort_column=name', 'optioncount=1'); ?>
    </ul>
     
    chopsticks, Nov 20, 2006 IP
  3. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nope. That sorts but takes away the count.

    Col :)
     
    Cheap SEO Services, Nov 20, 2006 IP
  4. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I was looking at the function for that, and on the Wordpress site it only shows 1 argument/parameter.

    '<?php wp_list_cats('arguments'); ?>'

    http://codex.wordpress.org/Template_Tags/wp_list_cats

    What about this?

    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=1'); ?>
    </ul>
     
    chopsticks, Nov 20, 2006 IP
  5. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Cheap SEO Services, Nov 20, 2006 IP
  6. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #6
    No problem, glad to help!

    and;

    Very nice. :)
     
    chopsticks, Nov 21, 2006 IP