Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="comments">
- <?php
- //---------------------------------------------------------------------
- // Evita que carguen directamente este archivo comments.php
- //---------------------------------------------------------------------
- if (!empty($_SERVER['SCRIPT-FILENAME']) && basename($_SERVER['SCRIPT-FILENAME']) == 'comments.php') {
- die(__('You cannot access to this page.', 'amk'));
- }
- //---------------------------------------------------------------------
- // Si el artículo está protegido muestra un texto
- //---------------------------------------------------------------------
- if (post_password_required()) : ?>
- <p><?php _e( 'This article is password protected', 'amk'); ?></p>
- </div>
- <?php return; ?>
- <?php endif;
- //---------------------------------------------------------------------
- // Si es que hay comentarios, se muestran
- //---------------------------------------------------------------------
- if (have_comments()) : ?>
- <?php //Muestra un titulo para los comentarios, hay 3 opciones: cuando no hay, cuando hay un solo comentario y cuando hay 2 o más ?>
- <h3><?php comments_number(__('Comment. be the first one:', 'amk'), __('There is only 1 comment. i know you want to say something:', 'amk'), __('% comments. <a href="#comment_box">Add a Comment:</a>', 'amk')); ?></h3>
- <ol id="comments-list">
- <?php wp_list_comments(); //Muestra el listado de comentarios y define el tamaño del avatar ?>
- </ol>
- <?php //Si es que los comentarios están paginados, muestra links para comentarios antiguos y recientes
- if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
- <ul class="pager">
- <li class="previous">← <?php previous_comments_link(__( 'Previous comments', 'amk')); ?></li>
- <li class="next"><?php next_comments_link(__( 'Recent comments', 'amk')); ?> →</li>
- </ul> <!-- end .pager -->
- <?php endif; ?>
- <?php
- //---------------------------------------------------------------------
- // Si no hay comentarios y los comentarios están cerrados muestra un texto
- //---------------------------------------------------------------------
- elseif (!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) : ?>
- <p><?php _e( 'Comments are not allowed in this article', 'amk');?></p>
- </div>
- <?php return; ?>
- <div id="comment_box">
- <?php endif;
- //---------------------------------------------------------------------
- // Muestra el formulario de comentarios
- //---------------------------------------------------------------------
- comment_form();
- ?>
- </div>
- </div><!-- end #comments-area -->
Advertisement
Add Comment
Please, Sign In to add comment