Numbering Comments in Decor Child Theme

Community Forums Forums Design Tips and Tricks Numbering Comments in Decor Child Theme

This topic is: resolved

This topic contains 4 replies, has 4 voices, and was last updated by  shaybocks 8 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12072

    myersbr2
    Participant
    Post count: 21

    I know it is possible to  number comments within WordPress and generally I wouldn’t be afraid to jump into the comments.php and change things, but I’m learning with Genesis that is a no-no.  So…can anyone help me?

    In the Decor child theme, how do I number my comments? I wanted to use a tutorial similar to (http://bavotasan.com/2009/how-to-add-numbers-to-your-comments-in-wordpress/).

    #14934

    wpspeak
    Participant
    Post count: 117

    You can use Greg Threaded Comment Numbering plugin.

    Use this code to add support to the plugin when using Genesis

    [php]/** Add comment numbering */
    add_action( ‘genesis_before_comment’, ‘modernblogger_numbered_comments’ );
    function modernblogger_numbered_comments () {
    if (function_exists( ‘gtcn_comment_numbering’ ))
    echo gtcn_comment_numbering($comment->comment_ID, $args);
    } [/php]

    This code was taken from Studiopress (tutorial section) few months ago and I just noticed they had remove it. Not sure why. But this code works and I’m using it on one of my themes I am currently develop.


    #43641

    SmockLady
    Participant
    Post count: 1

    Yes, I have been using this too quite successfully until just recently. I now am having trouble with the plugin dipslaying according to my settings. I don’t know which update messed it up (wordpress, genesis, or the/other plugin). My comment numbers only show 1, 2, 3, 4 etc when I have them set to show 1, 1.1, 1.2, 2. I host some giveaways and drawings on my blog and I don’t count the comment replies which are showing the whole numbers instead of the tiered ellipsis numbers. This may be why the tutorial disappeared. So if anyone knows a fix or a different plugin I’d love to know it.

    #95662

    shaybocks
    Participant
    Post count: 15

    This function doesn’t work unfortunately. I contacted the plugin developer about it and here’s his incredibly unhelpful response below. Anyone else able to write a working function??

    “As you can probably guess, this has nothing to do with the plugin or with WordPress and everything to do with faulty theme modification via a function that is not giving the plugin what it requires. This repeats a question about basic coding and the same faulty functions which I received just yesterday, so I’m going to paste in yesterday’s reply:

    As mentioned on the site, I’m not able to help folks with theme modifications beyond what is already provided in the plugin instructions, and not knowing anything about your particular theme or the particular theme-specific hooks you’re using or when they fire and under what conditions, it is quite literally impossible to tell much of anything from the code samples.

    However, what I will say is that I cannot see any reason why the functions you have used would work at all, let alone work correctly, since the functions would not, as written, have any access to either $comment or $args and therefore cannot pass them correctly to the comment numbering function. I would imagine that if you traced what is happening with all errors displayed, you might see repeated warnings about these variables being unknown. If your theme can provide the values of $comment and $args via the hooks you’re using, your functions will need those in order to operate correctly. There’s a further problem with the structure of both functions, in that the comment numbering function already echoes by default unless a fourth optional parameter is passed in to suppress that behaviour.

    As I say, however, all this is theme-specific, so I’ll need to leave you to it from here on out.”

    #95708

    shaybocks
    Participant
    Post count: 15

    So after talking with Greg more, I now know that he doesn’t even take on paid projects for wordpress development, so that’s why he wasn’t willing to help us out. He did give me more information, but unfortunately php programming is above my head:

    “In any case, the key for using the plugin via a custom function call attached to a hook is just making sure that the plugin gets passed what it needs in order to do its job. Any PHP developer will be able to look at the example functions and say “hey, wait a minute — these functions don’t have access to the two variables needed, so how can they pass those variables on to the plugin?”. I don’t use the Genesis themes myself, so I have no idea whether the hook being used with those example functions could actually supply those variables, but if it can, then all that would be needed would be to re-jigger the functions to make use of them and pass on the variables as the plugin requires. A developer happy to read through the Genesis code for the hook should be able to identify quickly whether the variables can be supplied and, if so, tweak the functions to make use of them.”

    Any developers out there know how we can fix this?

    • This reply was modified 8 months, 2 weeks ago by  shaybocks.
    • This reply was modified 8 months, 2 weeks ago by  shaybocks.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.