Pages
amazon.

Archives

Remove ‘View all posts filed under’ title from category links

Trying to remove the ‘View all posts filed under category name’ from the title tag on links, I searched and searched and couldn’t really find what I was looking for.

I did find a few hacks that would sort of work like changing the title tags to alt tags, etc. 

This is not what I wanted so I just used my trusty friend(s): the find command with egrep from a linux shell to locate the file that had the code that generated this annoying title tag and found it in the WP class located in wp-includes/classes.php file.

To find this on your server ( if you have shell access and its a linux / unix based server):

From your wordpress install directory.

$ find . -type f -exec egrep -li 'View all posts filed under' {} ;

It should return ./wp-includes/classes.php

Edit that file and around line 1332.

Here is the code you want to change.
$link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"';

If you just want the category name to show simply remove everything before the %s.

This line should now look like
$link .= 'title="' . sprintf(__( '%s' ), $cat_name) . '"';

Save and do a refresh from your web browser.

Now when you hover over the link it will only display the category name.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Google Bookmarks
  • TwitThis

One Response to “Remove ‘View all posts filed under’ title from category links”

  • Chad Justice says:

    I was also annoyed with the “View all posts filed under” Title, and really just wanted it to not display anything. In that classes.php file I noticed has line that appeared to be looking first for a description entry for the category
    if ( $use_desc_for_title == 0 || empty($category->description) )

    And if that description was empty it would use the line of code suggested to be modified above. I would prefer it have exactly what I wanted to “title” that category link or if I prefer, no title at all to pop up on mouseover.

    I found that whatever I enter in the description field gets displayed. And if I place the cursor in the description field and hit the spacebar once and then update the category, upon refreshing the page, it displays nothing for the “title” of the link!

    Problem solved :)

Leave a Reply

Spam Protection by WP-SpamFree