tags:

views:

27

answers:

3

the sidebar.php shows

<li>
 <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
</li>

so which php file generates the Categories in the sidebar (wrapped in a tags and with number of posts)?

+1  A: 

The function is located inside wp-includes/category-template.php

You can find out where any function is located by looking at the WordPress codex - at the bottom of each page, there is a link to where the function located.

Documentation for wp_list_categores

wp_list_categories function source code

slightlymore
As @Pat mentioned - if you want to edit the output of this function, use a custom theme filter. You should NEVER edit the core code of any piece of software unless you absolutely know what you're doing!
slightlymore
+1, thanks for that
pixeltocode
+2  A: 

If you're trying to change the output of this function, you can do it with a custom theme filter. Add the following to your theme's functions.php:

function custom_wp_list_categories($categories){
    // do something to the $categories returned by wp_list_categories()
    return $categories;
}
add_filter('wp_list_categories', 'custom_wp_list_categories');

The benefit of this approach is that it means that if you upgrade WordPress, you don't have to worry about making your changes again to the core files.

Pat
+1, thanks for that
pixeltocode
+1 for the caution about editing core files.
slightlymore
A: 

Why edit the core when there are so many options to choose from! http://codex.wordpress.org/Template_Tags/wp_list_categories

Sean Fisher