wordpress评论表单样式

wordpress评论表单样式,wordpress,Wordpress,我已经将HTML模板集成到Wordpress主题中。在菜单区中,有一个名为Blog的菜单。单击该菜单,我想显示所有帖子。点击一些特定的帖子标题,你应该进入单个帖子的页面。在那一页上应该有评论显示,这是正在张贴的一些人,以及评论形式,通过它可以评论该职位 下面是我的blog.php代码 <?php /* Template Name: Blog */ ?> <?php get_header(); ?> <div id="inner_contant

我已经将HTML模板集成到Wordpress主题中。在菜单区中,有一个名为Blog的菜单。单击该菜单,我想显示所有帖子。点击一些特定的帖子标题,你应该进入单个帖子的页面。在那一页上应该有评论显示,这是正在张贴的一些人,以及评论形式,通过它可以评论该职位

下面是我的blog.php代码

    <?php
/*
Template Name: Blog
*/
?>
<?php get_header(); ?>
        <div id="inner_contant">
            <div id="all_post">
                <?php
                    $myposts = get_posts('');
                    foreach($myposts as $post) :
                    setup_postdata($post);
                ?>
                <h2><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                <div class="author">Posted by <?php the_author(); ?></div>
                <div class="post_excerpt"><?php the_excerpt(); ?></div>
                <?php endforeach; wp_reset_postdata(); ?>
            </div>
        </div>
<?php get_footer(); ?>
下面是我的single.php代码

    <?php
/*
* The template for displaying all single posts and attachments
*/
?>
<?php get_header(); ?>
<div id="single_post_wrap">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <div class="time_and_author"><?php the_time('F jS, Y') ?> by <?php the_author() ?></div>
    <div class="post_content"><?php the_content(); ?></div>
    <p>Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    <?php endwhile; endif; ?>
        <?php  foreach (get_comments() as $comment): ?>
        <div><?php echo $comment->comment_author; ?> said: "<?php echo $comment->comment_content; ?>".</div>
        <?php endforeach; ?>
    <?php comments_template(); ?>    
</div>
</div>
<?php get_footer(); ?>
下面是我的comments.php代码

    <?php $comment_args = array(
            'comment_notes_after' => '',
            'title_reply' => 'Have something to say?'
        ) ?>
<?php comment_form($comment_args); ?>
我想在评论表单中添加一些样式。我什么都试过了,但都不管用。提前感谢那些帮助我的人。

WordPress'打印一个id为“commentform”的表单。因此,您可以使用CSS设置此表单的样式

form#commentform {
    // your styles.
}

form#commentform input {
    // your styles for inputs
}

/* default class of submit button is 'submit'. For changing it: add a
* key=>value to comment_form args like 
* 'class_submit' => 'your_submit_class'
*/
form#commentform .submit {
    // your submit button styles.
}
此外,您还可以更改注释表单的ID,如下所示:

<?php $comment_args = array(
    'comment_notes_after' => '',
    'title_reply' => 'Have something to say?',
    'id_form' => 'myAwesomeCommentForm'
) ?>
<?php comment_form($comment_args); ?>

谢谢@mht。我一整天都在为此而努力。这对我帮助很大。再次感谢。很抱歉不必要的争论,但是为什么我看不到绿色的勾号?谢谢@mht。我是新来的。因此,需要一些时间来熟悉它。