Support » Themes and Templates » list_cats without title attributes
11 years, 9 months ago
Is it possible to suppress the title tags on the links to categories generated by list_cats?
I initially thought that setting use_desc_for_title to 0 would do this, but the effect of that was to change the value of the title attribute not eliminate it.
I don’t know of a way to do this without hacking the function (a tiny bit). If you’re up to it:
list_cats() is in template-functions-category.php (wp-includes/ directory). The function starts around line 248; the line we’re looking for is at about line 315:
$link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
Just comment it out:
// $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
Hacking notes: Back up source files before editing them, and comment your changes for future reference.
Thanks, you made that really easy for me. It was done in seconds and it is working fine.