Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

[SOLVED] Numbering comments using Greg's Threaded Comment Plugin


  #1  
Old Apr 17, 2009, 06:21 AM
perdox808's Avatar
perdox808
 
51 posts · Apr 2009
Melbourne, Australia
Send a message via Skype™ to perdox808
Hi Flynn. I think I have been a bad boy; actually, an idiot.

I wanted to install Greg's Threaded Comment Numbering Plugin from http://counsellingresource.com/featu...for-wordpress/.

The instructions were:

replace wp_list_comments() in your theme’s comments.php file with wp_list_comments('callback=gtcn_basic_callback').

I found three of these instances and changed all three.

When testing, the first comment number was actually 0. So I went back to the original file and only replaced the first instance. This seemed to work as the comment numbering started at 1 and seemed to be working correctly.

Fearing that I might have problems further on, I wrote to the developer. Below is a transcript:

My file had this:

wp_list_comments(array(
‘avatar_size’=>$bfa_ata['avatar_size'],
‘reply_text’=>__(’ · Reply’,'atahualpa’),
‘login_text’=>__(’Log in to Reply’,'atahualpa’),
‘walker’ => new Walker_Comment2,
‘max_depth’ => ”,
’style’ => ‘ul’,
‘callback’ => null,
‘end-callback’ => null,
‘type’ => ‘comment’,
‘page’ => ”,
‘per_page’ => ”,
‘reverse_top_level’ => null,
‘reverse_children’ => ”
))
and now I have _list_comments(’callback=gtcn_basic_callback’) where all the above was. Is this OK?

In my comments.php file, there were 3 instances of the above and I replaced them all only to find that my comment numbers were starting from 0

The developer replied:

Your theme does not use the standard built-in WordPress comment walking class by itself, but rather extends it with some additional custom code. Therefore, I would recommend caution when replacing anything that might result in breaking the custom code extensions.

From a very cursory look, it appears that the theme’s default callback function is contained in the file bfa_comment_walker.php, starting around line 94. You could try modifying it by inserting a direct call to gtcn_comment_numbering, as described in the advanced usage instructions.

Alternatively, you might try giving the name of the basic callback function gtcn_basic_callback in the array which the theme is passing to wp_list_comments, rather than the null which is there now.

My best suggestion, though, would be to contact the author of the theme directly and ask them to support the plugin when the plugin is active. That way, the theme author can integrate the numbering functionality into the theme seamlessly, preserving their own custom modifications to the WordPress core code, without someone else like me coming along and trying to guess what to tweak where in order to work with the modifications — and possibly messing up all their hard work in the process.


Flynn, should I give up on this and go back to my old file (which I saved) or is it OK? I won't have problems in the future because of this change will I?

Thank you.
  #2  
Old Apr 17, 2009, 05:59 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
That's fine to do it that way and I am actually replacing that custom comment walker class with the "Wordpress way" to do this in 3.3.3, see also http://forum.bytesforall.com/showthread.php?t=1009

You can keep what you have now if you have no problems or use this instead to push the text (Log in to Reply...) and options (Avatar size) etc to the plugin's comment template as well

<!-- Do this for every comment -->
<?php if ($bfa_ata['separate_trackbacks'] == "Yes") {
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'comment',
));
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'pings',
));
} else {
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'all',
));
}
?>

Although this separation of comments and trackbacks might not work with the plugin so you might be better off using the short version you have now
  #3  
Old Apr 20, 2009, 02:58 AM
perdox808's Avatar
perdox808
 
51 posts · Apr 2009
Melbourne, Australia
Send a message via Skype™ to perdox808
Thanks again Flynn. I think I will take your advice and stick with what I have now. I am happy with the result so no need to push it!
  #4  
Old Oct 1, 2009, 03:18 PM
aquila423's Avatar
aquila423
 
5 posts · Sep 2009
I used what you did, below, and when I went to see the comment page, instead of the comments displaying, this error message came up...

Parse error: syntax error, unexpected '<' in /home/unspoke2/public_html/wp-content/themes/atahualpa/comments.php on line 32

Where did I go wrong?

Any help would be much appreciated :-)

Quote:
Originally Posted by Flynn
That's fine to do it that way and I am actually replacing that custom comment walker class with the "Wordpress way" to do this in 3.3.3, see also http://forum.bytesforall.com/showthread.php?t=1009

You can keep what you have now if you have no problems or use this instead to push the text (Log in to Reply...) and options (Avatar size) etc to the plugin's comment template as well

<!-- Do this for every comment -->
<?php if ($bfa_ata['separate_trackbacks'] == "Yes") {
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'comment',
));
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'pings',
));
} else {
wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => gtcn_basic_callback,
'type' => 'all',
));
}
?>

Although this separation of comments and trackbacks might not work with the plugin so you might be better off using the short version you have now
  #5  
Old Oct 1, 2009, 04:05 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
please post the 10 lines before and after line 32 of comment.php nd indicate what line is #32 and I'll take a look

Make sure you do a cut and paset right from teh code and past it into the post betweeh the HTML shortcode's (see the button - second row, second from teh end)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Dec 6, 2009, 06:01 AM
griffinjay
 
16 posts · May 2009
juggledad/Flynn,

I'm also trying to use Version 1.3.1 of Greg's Threaded Comment Numbering plugin but am stuck on how to deploy it with Atahualpa 3.4.4.

I've read his section "Advanced Usage: Calling WordPress Plugin Functions Directly" at:
http://counsellingresource.com/featu...for-wordpress/

but I'm still confused. Do I make modifications to both the comments.php file and the functions.php file? Others?

I've spent a couple hours trying stuff to no avail so a short step-by-step would be much appreciated!
  #7  
Old Dec 6, 2009, 10:01 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
All you do is edit comments.php and change lines 36, 44 and 54 in version 3.4.4 ( lines 42, 50 and 60 in version 3.4.9) from
HTML Code:
			'callback' => bfa_comments, 
to
HTML Code:
			'callback' => gtcn_basic_callback, 
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; May 24, 2010 at 09:39 AM.
  #8  
Old Dec 6, 2009, 10:16 AM
griffinjay
 
16 posts · May 2009
Splendid! Thanks so much, that worked perfertly.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying comments and comment form below each post on multi post pages, in 3.4.x Flynn Comments, trackbacks & pings 12 May 28, 2011 07:27 PM
[SOLVED] Is there an ATO way to disable the Comment Form URL versus tweaking comments fromtheranks Comments, trackbacks & pings 2 Jun 18, 2009 12:10 PM
changing threaded reply link location under the comment neocratus Comments, trackbacks & pings 1 May 31, 2009 06:13 AM
Threaded (nested) comments [X] levels deep?? botv0091 Comments, trackbacks & pings 0 Apr 23, 2009 06:15 AM
Bold Comments and Post-Text if i have 1 Comment Volker Post-Kicker, -Byline & -Footer 2 Feb 24, 2009 02:29 PM


All times are GMT -6. The time now is 11:00 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.