admin管理员组文章数量:1431434
Currently I'm styling as project where I need to add a custom CSS to the_author_posts_link()
.
I want to add the class "blog-link" with the the_author_posts_link()
. How do I add a css class to it?
Currently I'm styling as project where I need to add a custom CSS to the_author_posts_link()
.
I want to add the class "blog-link" with the the_author_posts_link()
. How do I add a css class to it?
1 Answer
Reset to default 5You can use the the_author_posts_link
filter to add the custom blog-link
class:
/**
* Add the 'blog-link' class to the output of the_author_posts_link()
*/
add_filter( 'the_author_posts_link', function( $link )
{
return str_replace( 'rel="author"', 'rel="author" class="blog-link"', $link );
});
本文标签: phptheauthorpostslink css class
版权声明:本文标题:php - the_author_posts_link css class 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745568376a2663897.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论