How do I edit Comments.php so I can add Schema markup to comment output?

admin2025-06-02  0

I can only find posts to edit the input and related fields.

How do I structure my edits to include proper schema markup? (I have written out what that should be)

I can only find posts to edit the input and related fields.

How do I structure my edits to include proper schema markup? (I have written out what that should be)

Share Improve this question asked Mar 3, 2019 at 0:06 Jeremy RiveraJeremy Rivera 1
Add a comment  | 

1 Answer 1

Reset to default 0

The comments are outputted via a callback function given as an argument in this function: wp_list_comments().

In your comments.php you will likely find the wp_list_comments() function with often a callback argument like so wp_list_comments( array ( 'callback' => 'callback_function_name'))

You can copy comments.php into your child-theme and modify the call to the function with a different callback function like so: wp_list_comments( array ( 'callback' => 'my_comments_html'))

Then find the function from your original callback parameter 'callback_function_name', copy it in your child theme (in functions.php or make another .php file and include it), rename the function to 'my_comments_html' and modify it there with the markup you like.

Hope that helps

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748846853a314217.html

最新回复(0)