Theme code:
City: <?php the_category(' | ') ?>
Html Code:
City: <a href="http://sitename.com/category/NY/" title="View all posts in NY" rel="category tag">NY</a>
i want to remove "View all posts in"
thank you
Theme code:
City: <?php the_category(' | ') ?>
Html Code:
City: <a href="http://sitename.com/category/NY/" title="View all posts in NY" rel="category tag">NY</a>
i want to remove "View all posts in"
thank you
anyone ?
ps: i want to keep: ... title="NY" ...
Edit the category-template.php file in wp-includes directory and delete all the "View all posts in" occurences.
Go to /wp-includes/classes.php, Edit classes.php 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) . '"';
The solution above removes it from the category list, usually in sidebars. To remove it in posts, remove it from /wp-includes/content-template.php
Just to clarify, it's actually found in /wp-includes/category-template.php
This seems like a good solution,
however
when you go to upgrade your WP version, the change gets deleted.
Can anyone offer a neat theme based solution?
Found a workaround here: http://bavotasan.com/tutorials/remove-the-title-attribute-from-wordpress-category-and-page-lists/
essentially it's using a regular expression to remove the title attribute after it's been created, i.e. in the theme (most likely in either functions.php or header.php)
This topic has been closed to new replies.