Jump to content
Sign in to follow this  
jane_l

Comment Hooks

Recommended Posts

jane_l

Are there any other hooks for comments? Because I am trying to get something to show up inside the individual comment loop and I tried using "pagelines_inside_bottom_pl_comments" and "pagelines_after_pl_comments" but both hooks put the function after the comment input box. I looked at the additional hooks but none of them pertain to the comments. Help? You can see the "Edit" link underneath the comment box here: http://dearauthor.com/book-reviews/overall-a-reviews/a-minus-reviews/review-a-night-of-scandal-by-sarah-morgan/

Share this post


Link to post
Share on other sites
cmunns

you would have directly edit the template for comments if you want a more specific injection of code. In your child theme you'd need to create your own comments.php file and also add a file called template.comments.php with this in it ` global $post; comments_template(); `

Share this post


Link to post
Share on other sites
jane_l

Where do I find the comments.php array? I want to keep the same styling but just add a php link.

Share this post


Link to post
Share on other sites
timlinson

comments.php is a file located in the first level of the platformpro folder.

Share this post


Link to post
Share on other sites
jane_l

Right, but it just calls to the wp comments list

<ol class="commentlist">
					<?php wp_list_comments(array('avatar_size' => 45)); ?>
				
Is there some special pagelines comment code or is it standard wordpress stuff? I.e., I can just replace that with:
<div id="comment-<?php comment_ID(); ?>" class="comment-body">
	        	<div class="comment-body-inner">
	        		<div class="comment-avatar">
						<?php echo get_avatar($comment, $size = '45', $default = get_bloginfo('stylesheet_directory').'/images/default-avatar.png' ); ?>
	                </div>
	                <!-- END avatar -->
						<div class="comment-author vcard">
					<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
				</div>
	            <!-- END comment-author vcard -->
				<?php if ($comment->comment_approved == '0') : ?>
					<?php _e('Your comment is awaiting moderation.') ?>
	
				<?php endif; ?>
	
				<div class="comment-meta commentmetadata">
					comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?>
					<?php edit_comment_link(__('(Edit)'),'  ','') ?>
				</div>
	            <!-- END comment-meta commentmetadata -->[/code]

Share this post


Link to post
Share on other sites
jane_l

Actually, I think what I need to do is replace the wp_list_comments() function call in the comments.php file akin to what is suggested here.

Share this post


Link to post
Share on other sites
Simon

I see those tutorials do not have dates, that one is replacing the old comments method, I think it was 2.8 or 2.9 the comments loop was refined and the main reply section was handled in wordpress core. So you would be taking a step backwards. What exactly are you trying to insert and where?

Share this post


Link to post
Share on other sites
jane_l

I was trying to insert some php code so that my users could edit their comments (I don't want to use AEC bc that is a bloated plugin). In the end, I used the code suggested here and it worked perfectly. The other link had you create a php file, but it is better to insert the function code in the function.php file. Thanks for trying to help. At least you led me in the right direction.

Share this post


Link to post
Share on other sites
Kate

Thanks for posting back with your solution, Jane.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×