Community Forums › Forums › Archived Forums › Design Tips and Tricks › Numbering Comments in Decor Child Theme
Tagged: comments, comments.php, decor, numbering comments
- This topic has 6 replies, 6 voices, and was last updated 8 years, 9 months ago by Sridhar Katakam.
-
AuthorPosts
-
January 15, 2013 at 10:57 am #12072January 25, 2013 at 8:04 pm #14934wpspeakMember
You can use Greg Threaded Comment Numbering plugin.
Use this code to add support to the plugin when using Genesis
/** 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); }
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.
June 2, 2013 at 12:40 pm #43641SmockLadyMemberYes, 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.
March 19, 2014 at 7:24 am #95662shaybocksMemberThis 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."
March 19, 2014 at 11:33 am #95708shaybocksMemberSo 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?
February 25, 2015 at 2:33 pm #142262achraeMemberAny new results on this?
I wish i was a php developer. ;-\
March 8, 2016 at 8:43 pm #180966 -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.