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] Quick/Dirty Comment Numbering


  #1  
Old May 24, 2010, 10:49 AM
rickheck
 
139 posts · Oct 2009
Here's how I did a quick comment numbering. No add-ins required, just edit two files (after making backup copies, of course).

Use the Editor to open the bfa_custom_comments.php file. Add the following after about line 4 (the "global $bfa_ata" line):


Code:
global $mycommentnumber;
$mycommentnumber=0;
In the same file, insert code similar to this where you want the comment number to appear ( I put it just before the 'printf" command at about line 25)

Code:
echo "(# " . $mycommentnumber . ") ";
Save the bfa_custom_comments.php file.

Then edit the "comments.php" file. After about line 12 (where it says "You can start editing below"), add these two lines:

Code:
global $mycommentnumber ;
$mycommentnumber = 0;
Save the file, and your comments will have a numbering like this:

Code:
(# 12)
The number will have the same style as the date/time line in the comment. If you want to change that, then use something like this in the bfa_custom_comments.php file:

Code:
echo "<div class = 'mycommentnumberstyle'>(# " . $mycommentnumber . ") </div>";
And then add the 'mycommentnumberstyle' style to the "add CSS/HTML inserts" section in the Atahualpa theme options.

Of course, make a backup copy of the files before you edit them, and save a copy of the changes somewhere so you can re-do them in case of a update.

Enjoy: it's not fancy, but it will work.

...Rick...
  #2  
Old Jul 3, 2010, 05:29 PM
Shan_LSOS
 
60 posts · Jun 2010
Will this still work with WP 3.0 and Atahualpa 3.5.1?
  #3  
Old Jul 3, 2010, 06:46 PM
rickheck
 
139 posts · Oct 2009
It does work with Atahualpa 3.5.1. Have not upgraded any of my blogs to WP 3.0 yet, waiting for a bit.

Thanks...Rick...
  #4  
Old Jul 3, 2010, 11:06 PM
Shan_LSOS
 
60 posts · Jun 2010
Ok I did this and all it shows is this where a comment number SHOULD be:

Code:
echo "(# " . $mycommentnumber . ") ";  ·
  #5  
Old Jul 3, 2010, 11:36 PM
rickheck
 
139 posts · Oct 2009
I would assume, then, that the code is not inside a "php" section.

Try putting a

Code:
<?php .... ?>
around that echo statement.

...Rick...
  #6  
Old Aug 25, 2010, 09:12 AM
mattmcg
 
2 posts · Aug 2010
Rick, i've followed your instructions, and added the code. The comment number appears on my blog, but it is always set to zero. Is there some other snippet of code which will automatically increment $mycommentnumber based on the number of the comment?

I am using a fresh install of WP 3.0.1 and Atahualpa 3.5.2

thanks!
  #7  
Old Aug 25, 2010, 09:30 AM
rickheck
 
139 posts · Oct 2009
Can't believe that I didn't notice this before. The problem is that we (well, me) never increment the comment number.

Change the first instruction/code extract to:

Code:
global $mycommentnumber;
$mycommentnumber ++;
Sorry about that. (Silly me.)


..Rick...
  #8  
Old Aug 25, 2010, 10:18 AM
mattmcg
 
2 posts · Aug 2010
Works perfectly, thanks for the quick solution!
  #9  
Old Aug 25, 2010, 10:20 AM
rickheck
 
139 posts · Oct 2009
Glad it worked. Sorry for the error.

And remember that any updates to the theme may require you re-doing the change.

...Rick..

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Numbering Comments f14testing@gmail.com Comments, trackbacks & pings 7 May 25, 2010 12:14 AM
[SOLVED] Numbering comments using Greg's Threaded Comment Plugin perdox808 Comments, trackbacks & pings 7 Dec 6, 2009 10:16 AM
Down and Dirty SEO juandrah Plugins & Atahualpa 5 Sep 24, 2009 08:52 PM
Please help... Comment numbering jmarsden92 Comments, trackbacks & pings 1 Jul 28, 2009 04:23 AM
[SOLVED] quick one - flash in the header mcphoto Header configuration & styling 2 Apr 30, 2009 07:57 AM


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


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