How can I remove the "category" string from this function.
function display_category_list($atts) {
return wp_list_categories(array('echo' => false));
}
add_shortcode('display-categories', 'display_category_list');
See developer wordpress See title_li
parameter.
'title_li' (string) Text to use for the list title
<li>
element. Pass an empty string to disable. Default 'Categories'.
for hiding title change your code to
function display_category_list($atts) {
return wp_list_categories(array(
'echo' => false,
'title_li' => '',
));
}
add_shortcode('display-categories', 'display_category_list');