我不知道我的评论部分的解决方案没有显示在我的单个帖子页面上。我注意到这个页面没有显示帖子和标签部分下面的任何代码。有人愿意为我查看管理员中的代码吗?我想这可能是一个很容易识别的东西,因为网站组织得很好。
这是我认为问题可以解决的唯一方法。
更新更新更新。这是Single.php
<?php get_header(); ?>
<?php include ('page_header.php'); ?>
<?php include ('page_navigation.php'); ?>
<div id="page-content" class="clearfix">
<div id="content-container" class="clearfix">
<div id="main-content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( get_option('minimax_post_layout') == 'head-three' ) { ?>
<h2><?php the_title(); ?><em>Posted on <?php the_time('D, M d, Y') ?></em></h2>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-item-thumb-<?php echo get_option('minimax_post_layout'); ?>">
<?php the_post_thumbnail('thumb_post_3'); ?>
</div>
<?php } ?>
<?php } else { ?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-item-thumb-<?php echo get_option('minimax_post_layout'); ?>">
<?php the_post_thumbnail('thumb_post_2'); ?>
</div>
<?php } ?>
<h2><?php the_title(); ?><em>Posted on <?php the_time('D, M d, Y') ?></em></h2>
<?php } ?>
<?php the_content(); ?>
<?php edit_post_link('Edit', '<br /><p>', '</p>'); ?>
<?php include ('post_related.php'); ?>
<div id="post-indexing"> <?php the_tags('<strong>Tagged as</strong> ',', ','+'); ?><br /><strong>Categorized as</strong> <?php the_category(', ','single'); ?></div>
<?php include ('post_author.php'); ?>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no pages matched your criteria.'); ?></p>
<?php endif; ?>
</div><!-- end main-content -->
<?php include ('sidebar_post.php'); ?>
</div><!-- end content-container -->
<?php include ('footer_columns_posts.php'); ?>
</div><!-- end page-content -->
<?php get_footer(); ?>
另外,这是comments.php页面:
<div id="comments">
<?php // Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'class="alt" ';
?>
<!-- You can start editing here. -->
<?php if ($comments) : ?>
<h2>Comments <span>(<?php comments_number('No Responses', 'One Response', '% Responses' );?
>)</span></h2>
<ul class="commentlist">
<?php wp_list_comments('avatar_size=60&type=comment'); ?>
</ul>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<div id="respond">
<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
<div class="cancel-comment-reply">
<?php cancel_comment_reply_link(); ?>
</div>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo
urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<div id="post-comment" class="clearfix">
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post"
id="commentform">
<fieldset>
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo
$user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?
action=logout" title="Log out of this account">Log out »</a></p>
<?php else : ?>
<label for="author"><?php if ($req) echo "* "; ?>Your name:</label>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22"
tabindex="1" />
<label for="email"><?php if ($req) echo "* "; ?>Mail (will not be published):</label>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>"
size="22" tabindex="2" />
<label for="url">Website</label>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22"
tabindex="3" />
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?
></code></small></p>-->
<label for="comment" class="comment">Your comment:</label>
<textarea name="comment" id="comment" class="comment" cols="61%" rows="10"
tabindex="4"></textarea>
<input name="submit" type="submit" class="submit" alt="Submit Comment" id="submit" tabindex="5"
value="Submit Comment" />
<input type="hidden" class="hide" name="comment_post_ID" value="<?php echo $id; ?>" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</fieldset>
</form>
</div><!-- end post-comment -->
</div>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
</div>
这是post_author.php
<?php if ( get_option('minimax_author') == 'yes' ) { ?>
<div id="author-desc" class="clearfix">
<?php the_author_image(); ?>
<h4>About the Author</h4>
<?php the_author_description(); ?>
</div>
<?php } ?>
答案 0 :(得分:1)
Wordpress中没有像the_author_image()
这样的功能。所以,你必须删除
<?php the_author_image(); ?>
post_author.php
的行。如果你想显示作者图像,Wordpress将从Gravatar获取头像。您可以使用get_avatar()显示作者的Gravatar。
echo get_avatar(get_the_author_id());
稍后,请使用:
<?php echo get_avatar(get_the_author_id()); ?>
而不是:
<?php the_author_image(); ?>