Comment form does not appear in topic

7

I'm creating a new WordPress theme and I can not seem to get the feedback form from the comments.php file. The other related elements (comments already saved, number of comments, etc.) appear normally, but the form itself does not appear even though I leave the comments open normally in blog .

The code is this:

<?php
   if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
   die ('Por favor não carregue esta página diretamente. Valeu!');

   if (post_password_required()) { ?>
       <p class="nocomments">Este artigo está protegido por senha.</p>
   <?php
       return;
   }
?>
<div class="comentarios row post-texto">
    <?php if ( have_comments() ) : ?>
        <ul class="commentlist">
            <?php wp_list_comments('avatar_size=64&type=comment'); ?>
        </ul>
        <?php if ($wp_query->max_num_pages > 1) : ?>
            <div class="pagination">
                <ul>
                    <li class="older"><?php previous_comments_link('Anteriores'); ?></li>
                    <li class="newer"><?php next_comments_link('Novos'); ?></li>
                </ul>
            </div>
        <?php endif; ?>
        <!-- Caixa de Comentários -->
    <?php endif; ?>
    <?php if ( comments_open() ) : ?>
        <form name="comment" id="formcomentario" method="POST" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php">
            <?php if ( $user_ID ) : ?>
            <div class="small-12 columns">
            <h5><?php comments_number('Seja o primeiro a comentar!', '1 Comentário. Participe da discussão!', '% Comentários. Participe da discussão!' );?></h5>
            <p>Autenticado como <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(); ?>" title="Encerrar sessão">[ENCERRAR SESSÃO]</a></p>
            </div>
        <?php else: ?>
        <div class="small-12 columns">
            <label>Seu nome (obrigatório)
                <input class="comentario-nome" type="text" value="<?php echo $comment_author; ?>" />
            </label>
        </div>
        <div class="small-6 columns">
            <label>Seu e-mail (obrigatório)
                <input class="comentario-email" type="text" value="<?php echo $comment_author; ?>" />
            </label>
        </div>
        <div class="small-6 columns">
            <label>Seu site (caso haja)
                <input class="comentario-url" type="text" value="<?php echo $comment_author_url; ?>" />
            </label>
        </div>
        <div class="small-12 columns">
            <label>Seu comentário
                <textarea class="comentario-texto"></textarea>
            </label>
        </div>
        <div class="small-12 columns">
            <a href="#" class="button expand botao-comentario">Enviar comentário</a>
        </div>
        <?php comment_id_fields(); ?>
        <?php do_action('comment_form', $post->ID); ?>
    </form>
    <p><?php cancel_comment_reply_link('Cancelar resposta'); ?></p>
        <?php endif; ?>
    <?php else: ?>
        <p>Os comentários estão fechados.</p>
<?php endif; ?>

What is the cause of this problem?

    
asked by anonymous 28.11.2014 / 19:54

1 answer

0

I managed to resolve. I decided not to write the form any more and use <?php comment_form(); ?>

    
01.12.2014 / 16:20