How to display comment meta under each comment content
I'm trying to display comment meta under each comment, but I couldn't find which action should I hook in.
Topic comments-template comment-meta comments Wordpress
Category Web
I'm trying to display comment meta under each comment, but I couldn't find which action should I hook in.
Topic comments-template comment-meta comments Wordpress
Category Web
As an easier alternative, you can use flexbox to reorder the comment items:
.comment-list article {
display: flex;
flex-wrap: wrap;
}
.comment-list .comment-meta,
.comment-list .comment-content {
flex: 0 0 100%;
}
.comment-list .comment-meta {
order: 2;
}
You will need get_comment_meta
to pull that information from the database. You will need to know the metakey. If you don't have that, you will have to search the theme/plugin that generates the metadata for the occurence of add_comment_meta
to find it.
Where to hook depends on how your theme is listing the comments. If it simply uses wp_list_comments
there is no filter to simply attach the metadata. You will need to change the callback argument using the wp_list_comments_args
filter. Then you can make a callback function that specifies which comment and meta data to display and how (learn more).
Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.