wordpress將留言區移到留言之上

這方這部份就是可以編寫留言的區域原始碼, 只要將這段程式碼移到 if ( have_comments() ) : 隻上就可以了! 當然依照每人版型不同, 會有些許的差異!

<?php if (‘open’ == $post->comment_status) : ?>
<div id=”respond”><h3>
<?php comment_form_title( __(‘發表留言’, ‘panorama’), __(‘Leave a Reply to %s’, ‘panorama’) ); ?></h3>
<div>    <small>
<?php cancel_comment_reply_link(__(‘Cancel Reply’,’panorama’)); ?></small>
</div>
<?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
<p>
<?php printf(__(‘You must be %slogged in</a> to post a comment.’, ‘panorama’), ‘<a href=”‘ . get_option(‘siteurl’) . ‘/wp-login.php?redirect_to=’ . urlencode(get_permalink()) . ‘”>’)?>
</p>
<?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.’, ‘panorama’), ‘<a href=”‘ . get_option(‘siteurl’) . ‘/wp-admin/profile.php”>’ . $user_identity . ‘</a>’)?>
<a href=”<?php echo wp_logout_url(get_permalink()); ?>” title=”<?php _e(‘Log out of this account’,’panorama’); ?>”>
<?php _e(‘Logout &raquo;’,’panorama’); ?></a>
</p>
<?php else : ?>
<p>
<input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” size=”22″ tabindex=”1″ <?php if ($req) echo “aria-required=’true'”; ?> />
<label for=”author”><small>
<?php _e(‘大名’,’panorama’); ?>
<?php if ($req) _e(‘(*必填)’,’panorama’); ?></small>
</label>
</p>
<p>
<input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email; ?>” size=”22″ tabindex=”2″ <?php if ($req) echo “aria-required=’true'”; ?> />
<label for=”email”><small>
<?php _e(‘電子信箱’,’panorama’); ?>
<?php if ($req) _e(‘(*必填)’,’panorama’); ?></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(‘網站或部落格’,’panorama’); ?></small>
</label>
</p>
<?php endif; ?>
<p>
<textarea name=”comment” id=”comment” style=”width:80%” rows=”6″ tabindex=”4″></textarea>
</p>
<p>
<input name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”<?php _e(‘確定送出’, ‘panorama’) ?>” />
<?php comment_id_fields(); ?>
</p>
<?php do_action(‘comment_form’, $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>

分類: 未分類

在〈wordpress將留言區移到留言之上〉中有 2 則留言

發表迴響