Sometimes you need to add pictures to make comments, but WordPress itself does not have the function of comment mapping. You can add the following code to the current theme functions.php file:
- add_action('comment_text', 'comments_embed_img', 2);
- function comments_embed_img( $comment ) {
- $size = auto;
- $comment = preg_replace( array ('#(http:
- return $comment ;
- }
After adding the above code, you can paste the image link address directly when posting a comment. The article comes from the knowledge that more birds- https://zmingcx.com/wordpress-comment-to-add-images.html
The specific effect can be posted in this article. The article comes from the knowledge that more birds- https://zmingcx.com/wordpress-comment-to-add-images.html The article comes from the knowledge that more birds- https://zmingcx.com/wordpress-comment-to-add-images.html
Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!