WordPress.org

Ready to get started?Download WordPress

Forums

list_cats without title attributes (3 posts)

  1. graemep
    Member
    Posted 8 years 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.

  2. Kafkaesqui

    Posted 8 years ago #

    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.

  3. graemep
    Member
    Posted 8 years ago #

    Thanks, you made that really easy for me. It was done in seconds and it is working fine.

Topic Closed

This topic has been closed to new replies.

About this Topic