1

When I hover over any post's comment link, I see the title: "Comment on Post Title". How can I remove it? I could not find this text in the theme.

Edit: Here's the source which generates the comments link:

<?php comments_popup_link( __('0', 'domain'), __( '1', 'domain'), __('%', 'domain')); ?>
2

The title attribute is hard-coded in comments_popup_link() unfortunately:

echo ' title="' . esc_attr( sprintf( __('Comment on %s'), $title ) ) . '">';

What you can do is catching the generated HTML in a variable and replacing the attribute with an empty string:

ob_start();
comments_popup_link();
print preg_replace( '~ title="[^"]+"~', '', ob_get_clean() );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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