Greg’s Threaded Comment Numbering

Sometimes it is helpful for a site, such as one running comment based contents, to display numbered comments. The Greg’s Threaded Comment Numbering plugin is a popular choice for doing this. The process for adding support for this plugin in Genesis is relatively simple.

Option #1 – Simple Hooks

If you are using the Simple Hooks plugin you can add the code below to the genesis_before_comments hook.

Be sure to check the box to Execute PHP on the hook.

<?php
    if (function_exists('gtcn_comment_numbering'))
    echo gtcn_comment_numbering($comment->comment_ID, $args);
?>

Option #2 – functions.php

Alternatively you can add the following code via functions.php

add_action ('genesis_before_comment', 'child_numbered_comments');
function child_numbered_comments () {
    if (function_exists('gtcn_comment_numbering'))
    echo gtcn_comment_numbering($comment->comment_ID, $args);
}  

Here’s some sample CSS that you can add to your child theme’s stylesheet to change the way the comment numbering looks.

.commentnumber {
    float: left;
    font-size :42px;
    font-style: italic;
    font-weight: bold;
    padding: 10px 10px 20px 0;
}