Suporte » Ajustando o WordPress » Problema com Comentários em “Pages”

  • Resolvido arthurnobrega

    (@arthurnobrega)


    Olá!

    Não estou conseguindo colocar os comentários para funcionar nas “pages”, estão funcionando apenas nos “posts”.

    Habilitei os comentários na página pela administração do wordpress, porém mesmo assim não aparece. O estranho é que no wordpress.com funcionava, porém quando eu migrei e escolhi um novo template (Arras Theme) ele parou de funcionar.

    Abaixo o código do comments.php do Arras Theme:

    <?php
    if ( !empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
    	die( __('Please do not load this page directly. Thanks!', 'arras') );
    if ( post_password_required() ) {
    	_e('<p class="nocomments">This post is password protected. Enter the password to view comments.</p>', 'arras');
    	return;
    }
    ?>
    <?php if ( have_comments() ) : ?>
    	<?php if ( !empty($comments_by_type['comment']) ) : ?>
    	<h4 class="module-title"><?php comments_number( __('No Comments', 'arras'), __('1 Comment', 'arras'), __ngettext('% Comment', '% Comments', get_comments_number(), 'arras') ); ?></h4>
    		<ol id="commentlist" class="clearfix">
    			<?php wp_list_comments('type=comment&callback=arras_list_comments'); ?>
    		</ol>
    		<div class="comments-navigation clearfix">
    			<div class="floatleft"><?php previous_comments_link() ?></div>
    		    <div class="floatright"><?php next_comments_link() ?></div>
    		</div>
    	<?php endif; ?>
    
    	<?php if ( !empty($comments_by_type['pings']) ) : ?>
    	<h4 class="module-title"><?php _e('Trackbacks / Pings', 'arras') ?></h4>
    	<ol class="pingbacks"><?php wp_list_comments('type=pings&callback=arras_list_trackbacks'); ?></ol>
    	<?php endif; ?>
    
    <?php else: ?>
    		<?php if ('open' == $post->comment_status) : ?>
    		<h4 class="module-title"><?php _e('No Comments', 'arras') ?></h4>
    		<p class="nocomments"><?php _e('Start the ball rolling by posting a comment on this article!', 'arras') ?></p>
    		<?php else : ?>
    		<h4 class="module-title"><?php _e('Comments Closed', 'arras') ?></h4>
    		<p class="nocomments"><?php _e('Comments are closed. You will not be able to post a comment in this post.', 'arras') ?></p>
    		<?php endif ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    <div id="respond">
    <h4 class="module-title"><?php comment_form_title( __('Leave a Reply', 'arras'), __('Leave a Reply to %s', 'arras') ); ?></h4>
     <div id="commentsform">
      <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
      <?php comment_id_fields(); ?>
       <?php if ( $user_ID ) : ?>
       <p>
    	   <?php printf( __('Logged in as <a href="%1$s" title="Logged in as %2$s">%3$s</a>.', 'arras'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity, $user_identity) ?>
    	   <a href="<?php echo wp_logout_url() ?> " title="<?php _e('Log out of this account', 'arras') ?>"> (<?php _e('Logout', 'arras') ?>)</a>
       </p>
       <?php else : ?>
        <p><label for="author"><?php _e('Name', 'arras') ?> <?php if ($req) _e('(required)', 'arras') ?></label><br />
         <input type="text" name="author" id="s1" value="<?php echo $comment_author; ?>" size="40" tabindex="1" minlength="2" <?php if (get_option('require_name_email')) : ?>class="required"<?php endif ?> />
        </p>
        <p><label for="email"><?php _e('Mail (will not be published)', 'arras') ?> <?php if ($req) _e('(required)', 'arras') ?></label><br />
         <input type="text" name="email" id="s2" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" <?php if (get_option('require_name_email')) : ?>class="required email"<?php endif ?> />
        </p>
        <p><label for="url"><?php _e('Website', 'arras') ?></label><br />
         <input type="text" name="url" id="s3" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" class="url" />
        </p>
       <?php endif; ?>
    	<p><?php printf( __('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'arras'), allowed_tags() ) ?></p>
        <p>
         <textarea name="comment" id="s4" cols="50" rows="10" tabindex="4" class="required"></textarea>
        </p>
    	<?php if(function_exists('show_subscription_checkbox')) : ?>
    	<p><?php show_subscription_checkbox() ?></p>
    	<?php endif; ?>
        <p>
         <input name="submit" type="submit" id="sbutt" tabindex="5" value="<?php _e('Submit Comment', 'arras') ?>" />
         <?php cancel_comment_reply_link( __('Cancel Reply', 'arras') ) ?>
        </p>
       <?php do_action('comment_form', $post->ID); ?>
      </form>
     <?php if(function_exists('show_manual_subscription_form')) { show_manual_subscription_form(); } ?>
     </div><!-- end #commentsform --></div>
     <?php endif ?>

    O endereço do blog é esse: http://www.ocliente.com e uma das páginas com esse erro: http://www.ocliente.com/outros-clientes/

    Quem tiver uma luz me ajudará muito!

    Muito obrigado!

    Arthur Nobrega

Visualizando 5 respostas - 1 até 5 (de um total de 5)
  • Criador do tópico arthurnobrega

    (@arthurnobrega)

    Quem consegue ter uma luz?

    Criador do tópico arthurnobrega

    (@arthurnobrega)

    alguém?

    Também não consigo!

    O meu tema, o iBlog 2.0 tem uma opção que desabilita os comentários nas páginas adicionais.

    Será que com você também não é isso?

    Kra, segue um codigo do comments.php que funciona com certeza.

    <?php // Não delete estas linhas
    	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)) { // Se for protegido por senha
    		if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { ?>
    			<p class="nocomments">Este post é projegido por senha. Coloque a senha para ver o post.</p>
    			<?php return;
    		}
    	}
    	/* É a variavel para alterar no fundo */
    	$oddcomment = 'class="alt" ';
    ?>
    
    <!-- Começe a Editar aqui. -->
    
    <?php if ($comments) : ?>
    	<h3><?php comments_number('Sem Comentários', 'Um Comentário', '% Comentários' );?> em “<?php the_title(); ?>”</h3>
    
    	<ul class="commentlist">
    
    	<?php foreach ($comments as $comment) : ?>
    
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    
    			<?php echo get_avatar( $comment, 32 ); ?>
    			<?php comment_author_link() ?>
    			<?php if ($comment->comment_approved == '0') : echo "<em>Seu comentário esta aguardando moderação.</em>"; endif; ?>
    
    			<?php comment_date('F jS, Y') ?>
    			<?php comment_time() ?>
    			<?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?>
    
    			<?php comment_text() ?>
    
    		</li>
    
    		<?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; ?>
    
    	<?php endforeach; ?>
    
    	</ul>
    
    	<?php else : // Isto é exibido se não houver nenhum comentario até agora ?>
    
    		<?php if ('open' == $post->comment_status) : ?>
    
    		<?php else : ?>
    		<p class="nocomments">Não estão permitidos comentários.</p>
    
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    <h3>Deixe uma resposta</h3>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>Você deve estar <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logado</a> para colocar um comentário.</p>
    
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    	<p>Logado como <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">Sair &raquo;</a></p>
    
    <?php else : ?>
    
    	<p class="clearfix"><label for="author">Nome <?php if ($req) echo "(required)"; ?></label> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /></p>
    
    	<p class="clearfix"><label for="email">Email (não vai ser compartilhado<?php if ($req) echo ", required"; ?>)</label> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /></p>
    
    	<p class="clearfix"><label for="url">Website</label> <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /></p>
    
    <?php endif; ?>
    
    	<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
    	<p class="clearfix"><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /></p>
    	<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; endif; ?>
Visualizando 5 respostas - 1 até 5 (de um total de 5)
  • O tópico ‘Problema com Comentários em “Pages”’ está fechado para novas respostas.