Last Updated: January 28, 2019
·
878
· dtommasino

Custom WordPress Comments

If you want to fully customize the look and feel comments section of your WordPress theme you can use a callback function in your comments.php file.

Somewhere in your comments.php use the following:

<?php wp_list_comments( 'callback=some_function' ); ?>

Now in your functions.php file create the function you defined above:

function some_function( ) {

Add custom html / php code here
Call the comment methods for each detail (getavatar, commenttext, etc.)

}

1 Response
Add your response

Wordpress should really look into using OOP hooks like MyBB does. It would be so much easier.

over 1 year ago ·