$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>How do I edit Comments.php so I can add Schema markup to comment output?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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

Post a comment

comment list (0)

  1. No comments so far