I can change label of comments by altering Comment(s) from parameter of following function: comments_popup_link('No Comments;', '1 Comment;', '% Comments;');
But, seems that title attribute is returned from core modules.
Suggest me to alter title attribute without editing core modules.
Leave a Reply
You must be logged in to post a comment.
If you look into the function
comments_popup_link()
you will see the following code at the end:Note the call to
__()
, the translation function. We can filter'gettext'
to change the result. Since we do not want to run our filter on every translation â that would be too slow â we start the filter when the hook'comments_popup_link_attributes'
is called:Now we need just the real filter function:
And now the title attribute says: Talk about The Post Title.
Like they said it’s hard coded into WP core, and it’s best practice to not mess with the core. However the title is located in
<span class="screen-reader-text">Post Title</span>
just use CSS to hide it..screen-reader-text{
display: none;
}