• Resolved maguiresc

    (@maguiresc)


    How can I add a time and date stamp to my wordpress comments.php, and where should it be inserted in the loop?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Can you put your theme’s comments.php in the pasetebin and give us the link to it.

    Thread Starter maguiresc

    (@maguiresc)

    Thanks… Its trevoralves.com

    The code is as follows for comments.php:

    <?php
    if ( post_password_required() ) { ?>
    	<p>This post is password protected. Enter the password to view comments.</p>
    <?php
    	return;
    }
    
    if( have_comments() ) : ?> 
    
    					<h5 class="cufon"><?php comments_number('No comment', 'Comment', '% Comments'); ?> for <?php the_title(); ?></h5><br/>
    
    					<?php wp_list_comments( array('callback' => 'pp_comment', 'avatar_size' => '40') ); ?>
    
    					<!-- End of thread -->
    					<br class="clear"/><br/>
    <?php endif; ?>  
    
    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
    			<div class="pagination"><p><?php previous_comments_link(); ?> <?php next_comments_link(); ?></p></div><br class="clear"/><div class="line"></div><br/><br/>
    <?php endif; // check for comment navigation ?>
    
    <?php if ('open' == $post->comment_status) : ?> 
    
    		<div id="respond">
    			<?php include(TEMPLATEPATH . '/templates/comments-form.php'); ?>
    		</div>
    
    <?php endif; ?>

    Thread Starter maguiresc

    (@maguiresc)

    Moderator keesiemeijer

    (@keesiemeijer)

    Your comments are made by the callback function pp_comment. You can find it in your theme’s functions.php. Something like this:

    function pp_comment(..) {
    // content of the function
    }

    Can you put it in the pastebin

    Thread Starter maguiresc

    (@maguiresc)

    functions.php

    Thanks I really appreciate this!

    Moderator keesiemeijer

    (@keesiemeijer)

    The function is not in there. I see you use the premium (paid for) theme Pleng. Did you ask there for a solution?

    Thread Starter maguiresc

    (@maguiresc)

    Yes, and unfortunately he is not able to assist. Is there a way to manually code the script into the functions.php page?

    Moderator keesiemeijer

    (@keesiemeijer)

    You can search your theme for this function: function pp_comment()

    Thread Starter maguiresc

    (@maguiresc)

    custom.lib.php

    Line 221 Shows pp_comment, how would I integrate that?

    Moderator keesiemeijer

    (@keesiemeijer)

    try it with this: custom.lib.php

    Thread Starter maguiresc

    (@maguiresc)

    That worked! Thanks! Do you mind me asking what code you used so I can reference for next time.

    Moderator keesiemeijer

    (@keesiemeijer)

    I changed this:

    <strong><i><?php echo $comment->comment_author; ?></i></strong>

    to this:

    <strong><i><?php printf(__('By %1$s on %2$s at %3$s'),
    					get_comment_author_link(),
    					get_comment_date('d M Y'),
    					get_comment_time('g:i a')); ?></i></strong>

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How To Add Time/Date Stamp to Comments.php’ is closed to new replies.