About wp_list_categories() function


This function is use for display or retrieve the HTML list of categories.
wp_list_categories ( string|array $args = ” )

  • ‘show_option_all’ ->
    (string) Type Text to display for showing all categories.
  • ‘show_option_none’ ->
    (string) Text to display for the ‘no categories’ option. Default ‘No categories’.
  • ‘orderby’ ->
    (string) This column is to use for ordering categories. Default ‘ID’.
  • ‘order’ ->
    (string) Which direction to order categories. Accepts ‘ASC’ or ‘DESC’. Default ‘ASC’.
  • ‘show_count’ ->
    (bool|int) Whether to show how many posts are in the category. Default 0.
  • ‘hide_empty’ ->
    (bool|int) Whether to hide categories that don’t have any posts attached to them. Default 1.
  • ‘use_desc_for_title’ ->
    (bool|int) Whether to use the category description as the title attribute. Default 1.
  • ‘feed’ ->
    (string) Text to use for the feed link. Default ‘Feed for all posts filed under [cat name]’.
  • ‘feed_type’ ->
    (string) Feed type. Used to build feed link. See get_term_feed_link(). Default empty string (default feed).
  • ‘feed_image’ ->
    (string) URL of an image to use for the feed link.
  • ‘child_of’ ->
    (int) Term ID to retrieve child terms of. See get_terms(). Default 0.
  • ‘exclude’ ->
    (array|string) Array or comma/space-separated string of term IDs to exclude. If $hierarchical is true, descendants of $exclude terms will also be excluded; see $exclude_tree. See get_terms().
  • ‘exclude_tree’ ->
    (array|string) Array or comma/space-separated string of term IDs to exclude, along with their
  • descendants. See get_terms() ->
    (bool|int) True to echo markup, false to return it. Default 1.
  • ‘current_category’ ->
    (int|array) ID of category, or array of IDs of categories, that should get the ‘current-cat’ class. Default 0.
  • ‘hierarchical’ ->
    (bool) Whether to include terms that have non-empty descendants. See get_terms(). Default true.
  • ‘title_li’ ->
    (string) Text to use for the list title element. Pass an empty string to disable. Default ‘Categories’.
  • ‘hide_title_if_empty’ ->
    (bool) Whether to hide the $title_li element if there are no terms in the list. Default false (title will always be shown).
  • ‘depth’ ->
    (int) Category depth. Used for tab indentation. Default 0.
  • ‘taxonomy’ ->
    (string) Taxonomy name. Default ‘category’.
  • ‘separator’ ->
    (string) Separator between links. Default ‘