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.

My use of the_category works fine, but I want to change the tooltip, which says "View all posts in (category name)".

How can I change this tooltip?

I guess this might be something similar to this.

Thank you

share|improve this question

2 Answers 2

You want to change the tooltip... but to what? Sorry my crystal ball isn't quite working today.

Here are some options you have:

  • Change it in wp-includes/category-template.php but that's far from ideal since an update will overwrite this.
  • You can add a function to your function.php file. For example if you want to remove it completely (since you didn't write how you want to change it):

    function categories_without_title_attribute() {
        $categories = wp_list_categories('echo=0');
        $categories = preg_replace('/title=\"(.*?)\"/','',$categories);
        echo $categories;
    }
    

Then of course use the fn to output your (modified) categories.

share|improve this answer
    
Thank you, I opted for the solution proposed below, which allows me to set the title I want without modifying master files. –  p.a. Jan 20 at 15:46

I used this solution instead, within my single.php file:

<?php
//categories loop

$categories = get_the_category();
$separator = ', ';
$output = '';
if($categories){
    foreach($categories as $category) {
        $output .= '<a href="'.get_category_link( $category->term_id ).'" title="' .     esc_attr( sprintf( __( "%s" ), $category->name ) ) . '">'.$category-    >cat_name.'</a>'.$separator;
    }
echo trim($output, $separator);
}
?>
share|improve this answer

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.