← WordPress

Wodpress caixa de resposta acima das mensagens

Lida 10215 vezes

Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter

No meu blog wordpress no final do artigo tem a caixa para deixar uma mensagem, porém o artigo tem 18 comentários e a pessoa precisar baixar até o final das respostas para achar a caixa e comentar.

Como posso deixar essa caixa sempre acima das respostas?
Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter

Deu erro mais eu acho que agora foi
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

O teu template tem um comments.php?

Se sim, edita o mesmo e se tiveres a função:

Código: [Seleccione]
<?php comment_form(); ?>
Basta movê-la para antes da listagem. Se preferires publica ou coloca o código do single.php / comments.php no https://pastebin.com/ para visualizar.
Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter

Tem sim o comments.php, porém eu não acho o <?php comment_form(); ?>.

Código: [Seleccione]
<?php
/**
 * The template for displaying the comments.
 *
 * This contains both the comments and the comment form.
 */

// 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!''schema' ) );
 
if ( 
post_password_required() ) { ?>

<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.''schema' ); ?></p>
<?php
return;
}
?>

<!-- You can start editing here. -->
<?php if ( have_comments() ) : ?>
<div id="comments">
<h4 class="total-comments"><?php comments_number(__('No Responses''schema' ), __('One Response''schema' ),  __('% Comments''schema' ) );?></h4>
<ol class="commentlist">
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?php wp_list_comments('callback=mts_comments'); ?>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
</ol>
</div>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>

<?php else : // comments are closed ?>

<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>
<div id="commentsAdd">
<div id="respond" class="box m-t-6">
<?php global $aria_req$comments_args = array(
'title_reply'=>'<h4><span>'.__('Leave a Reply''schema' ).'</span></h4>',
'comment_notes_before' => '',
'comment_notes_after' => '',
'label_submit' => __'Post Comment''schema' ),
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="'.__('Comment Text*''schema' ).'"></textarea></p>',
'fields' => apply_filters'comment_form_default_fields',
array(
'author' => '<p class="comment-form-author">'
.( $req '' '' ).'<input id="author" name="author" type="text" placeholder="'.__('Name*''schema' ).'" value="'.esc_attr$commenter['comment_author'] ) . '" size="30"' $aria_req ' /></p>',
'email' => '<p class="comment-form-email">'
.($req '' '' ) . '<input id="email" name="email" type="text" placeholder="'.__('Email*''schema' ).'" value="' esc_attr(  $commenter['comment_author_email'] ).'" size="30"'.$aria_req.' /></p>',
'url' => '<p class="comment-form-url"><input id="url" name="url" type="text" placeholder="'.__('Website''schema' ).'" value="' esc_url$commenter['comment_author_url'] ) . '" size="30" /></p>'

)
); 
comment_form($comments_args); ?>

</div>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>


Ou prefere que publique no pastebin?
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Neste caso deverás cortar o código abaixo:

Código: [Seleccione]
<?php if ('open' == $post->comment_status) : ?>
   <div id="commentsAdd">
      <div id="respond" class="box m-t-6">
         <?php global $aria_req$comments_args = array(
               
'title_reply'=>'<h4><span>'.__('Leave a Reply''schema' ).'</span></h4>',
               
'comment_notes_before' => '',
               
'comment_notes_after' => '',
               
'label_submit' => __'Post Comment''schema' ),
               
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="'.__('Comment Text*''schema' ).'"></textarea></p>',
               
'fields' => apply_filters'comment_form_default_fields',
                  array(
                     
'author' => '<p class="comment-form-author">'
                     
.( $req '' '' ).'<input id="author" name="author" type="text" placeholder="'.__('Name*''schema' ).'" value="'.esc_attr$commenter['comment_author'] ) . '" size="30"' $aria_req ' /></p>',
                     
'email' => '<p class="comment-form-email">'
                     
.($req '' '' ) . '<input id="email" name="email" type="text" placeholder="'.__('Email*''schema' ).'" value="' esc_attr(  $commenter['comment_author_email'] ).'" size="30"'.$aria_req.' /></p>',
                     
'url' => '<p class="comment-form-url"><input id="url" name="url" type="text" placeholder="'.__('Website''schema' ).'" value="' esc_url$commenter['comment_author_url'] ) . '" size="30" /></p>'
                  

               )
            ); 
         
comment_form($comments_args); ?>

      </div>
   </div>
<?php endif; // if you delete this the sky will fall on your head ?>

E colar na linha abaixo desta:

Código: [Seleccione]
<!-- You can start editing here. -->

Testa e depois diz se ficou como pretendido :)
Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter

Desculpas, mas eu não consegui entender muito bem a sua resposta.

É para apagar isso tudo?

Código: [Seleccione]
<?php if ('open' == $post->comment_status) : ?>
   <div id="commentsAdd">
      <div id="respond" class="box m-t-6">
         <?php global $aria_req$comments_args = array(
               
'title_reply'=>'<h4><span>'.__('Leave a Reply''schema' ).'</span></h4>',
               
'comment_notes_before' => '',
               
'comment_notes_after' => '',
               
'label_submit' => __'Post Comment''schema' ),
               
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="'.__('Comment Text*''schema' ).'"></textarea></p>',
               
'fields' => apply_filters'comment_form_default_fields',
                  array(
                     
'author' => '<p class="comment-form-author">'
                     
.( $req '' '' ).'<input id="author" name="author" type="text" placeholder="'.__('Name*''schema' ).'" value="'.esc_attr$commenter['comment_author'] ) . '" size="30"' $aria_req ' /></p>',
                     
'email' => '<p class="comment-form-email">'
                     
.($req '' '' ) . '<input id="email" name="email" type="text" placeholder="'.__('Email*''schema' ).'" value="' esc_attr(  $commenter['comment_author_email'] ).'" size="30"'.$aria_req.' /></p>',
                     
'url' => '<p class="comment-form-url"><input id="url" name="url" type="text" placeholder="'.__('Website''schema' ).'" value="' esc_url$commenter['comment_author_url'] ) . '" size="30" /></p>'
                  

               )
            ); 
         
comment_form($comments_args); ?>

      </div>
   </div>
<?php endif; // if you delete this the sky will fall on your head ?>

E logo abaixo disse que apaguei colocar essa linha?

<!-- You can start editing here. -->
Offline

kurtmix 
Membro
Mensagens 1895 Gostos 605
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Search Level 5 Windows User Super Combination Combination Topic Starter

Desculpas, mas eu não consegui entender muito bem a sua resposta.

É para apagar isso tudo?

Código: [Seleccione]
<?php if ('open' == $post->comment_status) : ?>
   <div id="commentsAdd">
      <div id="respond" class="box m-t-6">
         <?php global $aria_req$comments_args = array(
               
'title_reply'=>'<h4><span>'.__('Leave a Reply''schema' ).'</span></h4>',
               
'comment_notes_before' => '',
               
'comment_notes_after' => '',
               
'label_submit' => __'Post Comment''schema' ),
               
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="'.__('Comment Text*''schema' ).'"></textarea></p>',
               
'fields' => apply_filters'comment_form_default_fields',
                  array(
                     
'author' => '<p class="comment-form-author">'
                     
.( $req '' '' ).'<input id="author" name="author" type="text" placeholder="'.__('Name*''schema' ).'" value="'.esc_attr$commenter['comment_author'] ) . '" size="30"' $aria_req ' /></p>',
                     
'email' => '<p class="comment-form-email">'
                     
.($req '' '' ) . '<input id="email" name="email" type="text" placeholder="'.__('Email*''schema' ).'" value="' esc_attr(  $commenter['comment_author_email'] ).'" size="30"'.$aria_req.' /></p>',
                     
'url' => '<p class="comment-form-url"><input id="url" name="url" type="text" placeholder="'.__('Website''schema' ).'" value="' esc_url$commenter['comment_author_url'] ) . '" size="30" /></p>'
                  

               )
            ); 
         
comment_form($comments_args); ?>

      </div>
   </div>
<?php endif; // if you delete this the sky will fall on your head ?>

E logo abaixo disse que apaguei colocar essa linha?

<!-- You can start editing here. -->
Ningém falou em apagar, é cortar e colar, para mover de sitio, acho simples de entender.
Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter

Agradeço pela resposta, mas eu não entendi por isso perguntei novamente ao bfms.
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

:) Resultou?
Offline

Mister_Magoo 
Membro
Mensagens 594 Gostos 38
Troféus totais: 29
Trófeus: (Ver todos)
Nineth year Anniversary Eighth year Anniversary Quick Poster Signature Level 5 Search Windows User Super Combination Combination Topic Starter