Comment Numbering


Author Message
Rudi

Posted: 4/11/2014
Quote message 

I have created some fine WordPress Themes with Artisteer 4.1, but I need to somehow add COMMENT NUMBERS to every comment, preferably on the RIGHT TOP CORNER of each Comment, so that when replying to a comment, the comment number can be referred to.

I cannot seem to find something suitable here in the Artisteer Forums and any help sought on the wider Net gives a few possibilities, but they do not seem to work within the Artisteer Themes as built, running on the latest version of WordPress.

I looked for Plugins to achieve this, but the coding of the available Plugins are so old that they just do not work in THIS Artisteer Theme environment and / or in the most recent WordPress platform.

It will be extremely helpful for my busy Rugby website, www.rugby-talk.com

Kindly help a fella out here, I will appreciate it tremendously.
 
Rudi

Posted: 4/13/2014
Quote message 

I have stumbled, experimented and bumbled my way, seeing as I am not yet much of a php coder and found a way to do it!!

I do it through adding the Plugin: Greg's Threaded Comment Numbering, but one cannot just Install, Activate and Run the Plugin, one also has to edit the Theme Functions (functions.php file) of your Artisteer Theme.

As an aside, and a handy tip - I use a simple Code Editor which works very well, called EditPlus 3, which gives me the line numbers, which I will refer to here.

At my Line No 708, the function theme_comment($comment, $args, $depth) appears, which governs the output of a comment - your Line Numbering might be different, so look for the same function about 85% down in the functions.php file.

Just after the art-comment-avatar string (Line 715) and before the art-comment-inner string, I added the following:

<h1 style="text-align: right;"><span style="color: #000080;"><strong><?php echo gtcn_comment_numbering($comment->comment_ID, $args); ?>
<div id="comment-<?php comment_ID(); ?>"></strong></span></h1>

As a result I now, with the aid of Greg's Threaded Comment Numbering Plugin, have a dark blue Comment Number on the righthand side, of good size, which looks OK, yet not spectacular.

In other words my function theme_Comment (in functions.php file), now reads as follows (it's the portion between the 2 rows of stars, so in the file there are no rows of stars):

***********************************
function theme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
switch ($comment->comment_type) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="art-comment <?php echo $comment->comment_type ?> clearfix" id="comment-<?php comment_ID() ?>">
<div class="art-comment-avatar"><?php echo theme_get_avatar(array('id' => $comment, 'size' => 60)); ?></div><h1 style="text-align: right;"><span style="color: #000080;"><strong><?php echo gtcn_comment_numbering($comment->comment_ID, $args); ?>
<div id="comment-<?php comment_ID(); ?>"></strong></span></h1>
<div class="art-comment-inner">
<div class="art-comment-header comment-meta commentmetadata"><?php printf(__('%s on ', THEME_NS), get_comment_author_link($comment->comment_ID)); ?>
<a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s at %2$s', THEME_NS), get_comment_date(), get_comment_time()); ?></a>
<?php edit_comment_link(__('(Edit)', THEME_NS)); ?></div>
<div class="art-comment-content comment-body"><?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.', THEME_NS); ?></em>
<br />
<?php endif; ?>
<?php comment_text(); ?></div>
<div class="art-comment-footer reply"><?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?></div>
</div>
</div>
<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<div class="art-comment <?php echo $comment->comment_type ?> clearfix">
<div class="art-comment-content comment-body"><?php _e('Pingback:', THEME_NS); ?> <?php comment_author_link(); ?><?php edit_comment_link(__('(Edit)', THEME_NS), ' '); ?></div>
</div>
<?php
break;
endswitch;
}
*******************************

This is a good fix for now, but I could certainly do with help to not use the Pluging - Greg's Threaded Comment Numbering and I could certainly do with help to STYLE the Comment Number more, regarding SIZE in pixels, COLOR, BACKGROUND, BORDER, and POSITION where the comment Number appears.

Kindlly help with coding to make our own Comment Numbering system, to be added to the Theme Functions (functions.php file) or added to the Stylesheet (style.css file).

I hope this comment of mine at least gives some light in a dark tunnel to some other Artisteer 4.1 users.

Regards,
Rudi
 
Rudi

Posted: 4/23/2014
Quote message 

Has anybody got an answer for me, on doing and Styling my own Comment Numbering.... in light of the above 2 comments?
 
www

Posted: 4/24/2014
Quote message 

You need javascript for this. As some comment quote plugins, check how they do it with code.