Remove the word ‘Categories’ from wp_list_categories

I’ve got the following code: wp_list_categories();

It outputs all my categories, however, it makes them the child of a list element, called CATEGORIES.

So, I get an unordered list, like so:

CATEGORIES
* FASHION
* DAILY FASHION CANDY
* TRENDS
* BEAUTY
* ACCESSORIES
* CELEBRITIES
* LIFESTYLE

However, I only need:

* FASHION
* DAILY FASHION CANDY
* TRENDS
* BEAUTY
* ACCESSORIES
* CELEBRITIES
* LIFESTYLE

I’m sure I could remove/hide the word CATEGORIES with JS or CSS, but is there a way to prevent it being there in the first place?

1
1

Take a look at the parameters in the documentation of wp_list_categories() function.

You need to use this parameter:

title_li

(string) Set the title and style of the outer list item. Defaults to “Categories”. If present but empty, the outer list item will not be displayed. See below for examples.

I think it’s clear, you just need to pass this parameter as an empty string:

wp_list_categories('title_li=');

Leave a Comment