Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm placing a list of category links with this code:

<div><h2>Categories List</h2>
    <ul>
    <?php          
        function my_cat_title($category_description,$category){
            return '';
        }

        $cat_args = array('orderby' => 'name');
        $cat_args['title_li'] = '';
        $cat_args['exclude_tree'] = 1;
        $cat_args['use_desc_for_title'] = 1;
        add_filter('category_description','my_cat_title');
        wp_list_categories(apply_filters('widget_categories_args', $cat_args));
        remove_filter('category_description','my_cat_title');

        ?>
    </ul>
</div>

However, each of the links has a title attribute like 'title="View all posts filed under x"'

How can I remove the title attribute altogether?

share|improve this question

1 Answer 1

If you use the category_description filter hook you can replace the title attribute for example:

function my_cat_title($category_description,$category){
   return '';
}
add_filter('category_description','my_cat_title');
$cat_args = array('orderby' => 'name');
$cat_args['title_li'] = '';
$cat_args['exclude_tree'] = my_cat();
wp_list_categories(apply_filters('widget_categories_args', $cat_args));
remove_filter('category_description','my_cat_title');
share|improve this answer
    
+1 Thanks! Testing it now. –  N2Mystic Aug 19 '11 at 14:37
    
Hmm, its not working for me :-( I've updated my question with the revised code. I'm still getting a title attribute on the links –  N2Mystic Sep 7 '11 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.