Move Comment Reply Box

Home Forums Techozoic Move Comment Reply Box

This topic contains 2 replies, has 1 voice, and was last updated by  Jeremy Clark 7 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
April 26, 2010 at 5:48 am #858

Jeremy Clark

Hello!

Not the biggest expert in PHP but would like to know how to move the comment box so it is ABOVE the comments, i.e. the first thing you see before the comments. Any help on this would be great.

Thanks,
Dan

EDIT: Also while I’m here how can I change the ordering of the comments so that the latest comment is on top….?

April 26, 2010 at 6:43 am #859

Jeremy Clark

Ok this isn’t very complicated but it does require moving a big chunk of code. This code below is assuming your using Techozoic 1.8.6.1. You probably want to create a child theme that way you’ll still be able to update, there is a good tutorial on how to do this here http://op111.net/53 . If your using a child theme just copy the comments.php file to your child theme directory and edit it otherwise edit the comments.php in the techozoic-fluid directory.

You’ll need to look for this block of code at the bottom of the file.

if (‘open’ == $post->comment_status) { ?>
<div id="respond">
<?php if (function_exists(‘cancel_comment_reply_link’)) {
?>
<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link();?></small>
</div>
<?php }
?>
<?php if (function_exists(‘comment_form_title’)) {
?>
<h3><?php comment_form_title(__(‘Leave a Reply’,’techozoic’), __(‘Leave a Reply to %s’,’techozoic’)); ?></h3>
<?php } else {
?> <h3><?php _e(‘Leave a Reply’,’techozoic’)?></h3><?php
}
if ( get_option(‘comment_registration’) && !$user_ID ) {
?>
<p><?php printf(__(‘You must be %s to post a comment.’,’techozoic’), "<a href="". get_option(‘siteurl’). "/wp-login.php?redirect_to=" . get_permalink(). "">". __(‘logged in’,’techozoic’). "</a>")?></p>
</div>
<?php } else { ?>
<form action="<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) { ?>
<p><?php printf(__(‘Logged in as %s’,’techozoic’), ‘<a href="’ .get_option(‘siteurl’) .’/wp-admin/profile.php">’ . $user_identity . ‘</a>.’)?> <a href="<?php echo get_option(‘siteurl’); ?>/wp-login.php?action=logout" title="<?php _e(‘Log out of this account’, ‘techozoic’)?>"><?php _e(‘Logout’,’techozoic’)?> &raquo;</a></p>
<?php } else { ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small><?php _e(‘Name’,’techozoic’)?> <?php if ($req) _e(‘(required)’,’techzoic’); ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small><?php _e(‘Mail (will not be published)’,’techozoic’)?> <?php if ($req) _e(‘(required)’,’techzoic’);; ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e(‘Website’,’techozoic’)?></small></label></p>

<?php }
if (function_exists(‘comment_id_fields’)) comment_id_fields(); ?>
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e(‘Submit Comment’,’techozoic’)?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action(‘comment_form’, $post->ID); ?>
</form>
</div>
<?php } // If registration required and not logged in
} //End if comment open

You’ll need to cut the code from it’s current place then paste it at the top above this code here.

if (function_exists(‘wp_list_comments’)) {
//WP 2.7 Comment Loop
if ( have_comments() ) { ?>

To change the order of comments you can do that in the Dicussion Settings of your wordpress dashboard. There is an option for display newer or older comments first, and and option for breaking comments into pages if that is checked you’ll need to make sure that it displays the first page instead of last page.

April 26, 2010 at 6:54 am #860

Jeremy Clark

Thanks Jeremy! Much help has been greatly appreciated. 😆

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.