Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.06 KB | None | 0 0
  1. <?php
  2.    
  3.     if ( !defined('ABSPATH') ){ die(); }
  4.    
  5. /**
  6.  * The template for displaying Comments.
  7.  *
  8.  * The area of the page that contains both current comments
  9.  * and the comment form.  The actual display of comments is
  10.  * handled by a callback which is
  11.  * located in the loop-comments.php file.
  12.  *
  13.  */
  14. ?>
  15.  
  16. <?php if ( post_password_required() ) :
  17.  
  18.  if (comments_open() ) :
  19.     ?>
  20.         <p><?php _e( 'This post is password protected. Enter the password to view any comments.', 'avia_framework' ); ?></p>
  21.     <?php
  22. endif;
  23.         /* Stop the rest of comments.php from being processed,
  24.          * but don't kill the script entirely -- we still have
  25.          * to fully load the template.
  26.          */
  27.         return;
  28.    
  29. endif;
  30. ?>
  31.  
  32. <?php
  33.     // You can start editing here -- including this comment!
  34.    
  35.     //create seperator
  36.     //if(comments_open() || get_comments_number()) echo "<div class='hr hr_invisible'></div>";
  37. ?>
  38.  
  39.                
  40.                
  41. <div class='comment-entry post-entry'>
  42.  
  43. <?php
  44.  
  45.  if ( get_comments_number() != "0" || comments_open() ) : ?>
  46. <div class='comment_meta_container'>
  47.            
  48.             <div class='side-container-comment'>
  49.                    
  50.                     <div class='side-container-comment-inner'>
  51.                         <?php
  52.                         $ccount = (int) get_comments_number();
  53.                         $rep    = __( 'replies', 'avia_framework' );
  54.                         if($ccount === 1) $rep  = __( 'reply', 'avia_framework' );
  55.                         ?>
  56.                        
  57.                         <span class='comment-count'><?php echo $ccount; ?></span>
  58.                         <span class='comment-text'><?php echo $rep; ?></span>
  59.                         <span class='center-border center-border-left'></span>
  60.                         <span class='center-border center-border-right'></span>
  61.                        
  62.                     </div>
  63.                    
  64.                 </div>
  65.            
  66.             </div>
  67.  
  68. <?php
  69. endif;
  70.  
  71. if ( have_comments() ) : ?>
  72.            
  73.             <div class='comment_container'>
  74.            
  75.  
  76. <?php      
  77.  
  78.  
  79.     /* Last but not least the comment_form() wordpress function
  80.      * renders the comment form as defined by wordpress itself
  81.      * if you want to modify the submission form check the documentation here:
  82.      * http://codex.wordpress.org/Function_Reference/comment_form
  83.      */
  84.     if(comments_open())
  85.     {
  86.        $default_heading = 'h3';
  87.        $args = array(
  88.                    'heading'        => $default_heading,
  89.                    'extra_class'    => ''
  90.                );
  91.  
  92.        /**
  93.         * @since 4.5.5
  94.         * @return array
  95.         */
  96.        $args = apply_filters( 'avf_customize_heading_settings', $args, 'comments_open', array() );
  97.  
  98.        $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading;
  99.        $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : '';
  100.        
  101.         echo "<div class='comment_container'>";
  102.         echo "<{$heading} class='miniheading {$css}'>".__('Leave a Reply','avia_framework')."</{$heading}>";
  103.         echo "<span class='minitext'>".__('Want to join the discussion?','avia_framework')." <br/>".__('Feel free to contribute!','avia_framework')."</span>";
  104.         comment_form();
  105.         echo "</div>";
  106.     }
  107.     else if(get_comments_number())
  108.     {
  109.        $default_heading = 'h3';
  110.        $args = array(
  111.                    'heading'        => $default_heading,
  112.                    'extra_class'    => ''
  113.                );
  114.  
  115.        /**
  116.         * @since 4.5.5
  117.         * @return array
  118.         */
  119.        $args = apply_filters( 'avf_customize_heading_settings', $args, 'comments_closed', array() );
  120.  
  121.        $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading;
  122.        $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : '';
  123.        
  124.        
  125.         /* If there are no comments and comments are closed,
  126.         * let's leave a little note, shall we?
  127.         */
  128.        
  129.         echo "<{$heading} class='commentsclosed {$css}'>".__( 'Comments are closed.', 'avia_framework' )."</{$heading}>";
  130.     }
  131.    
  132.         if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through?
  133.             echo "<span class='comment_page_nav_links comment_page_nav_links_top'>";
  134.             echo "<span class='comment_prev_page'>";
  135.                  previous_comments_link( __( '&laquo; Older Comments', 'avia_framework' ) );
  136.             echo "</span>";
  137.             echo "<span class='comment_next_page'>";
  138.                  next_comments_link( __( 'Newer Comments &raquo;', 'avia_framework' ) );
  139.             echo "</span>";
  140.             echo "</span>";
  141.         endif; // check for comment navigation
  142.        
  143.        
  144.             //get comments
  145.             $comment_entries = get_comments(array( 'type'=> 'comment', 'post_id' => $post->ID ));
  146.            
  147.             if(!empty($comment_entries)){
  148.            
  149.             ?>
  150.             <ol class="commentlist" id="comments">
  151.                 <?php
  152.                     /* Loop through and list the comments. Tell wp_list_comments()
  153.                      * to use avia_inc_custom_comments() to format the comments.
  154.                      * If you want to overload this in a child theme then you can
  155.                      * define avia_framework_comment() and that will be used instead.
  156.                      * See avia_framework_comment() in includes/loop-comments.php for more.
  157.                      */
  158.                     wp_list_comments( array( 'type'=> 'comment', 'callback' => 'avia_inc_custom_comments' ) );
  159.                 ?>
  160.             </ol>
  161.             <?php
  162.             }
  163.            
  164.            
  165.             //get ping and trackbacks
  166.             $ping_entries = get_comments(array( 'type'=> 'pings', 'post_id' => $post->ID ));
  167.            
  168.             if(!empty($ping_entries)){
  169.             echo "<h4 id='pingback_heading'>".__('Trackbacks &amp; Pingbacks','avia_framework')."</h4>";
  170.             ?>
  171.            
  172.             <ol class="pingbacklist">
  173.                 <?php
  174.                     /*
  175.                      * Loop through and list the pingbacks and trackbacks.
  176.                      */
  177.                     wp_list_comments( array( 'type'=> 'pings', 'reverse_top_level'=>true ) );
  178.                 ?>
  179.             </ol>
  180.             <?php } ?>
  181.            
  182.            
  183.            
  184.            
  185.            
  186. <?php
  187.         if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through?
  188.             echo "<span class='comment_page_nav_links comment_page_nav_links_bottom'>";
  189.             echo "<span class='comment_prev_page'>";
  190.                  previous_comments_link( __( '&laquo; Older Comments', 'avia_framework' ) );
  191.             echo "</span>";
  192.             echo "<span class='comment_next_page'>";
  193.                  next_comments_link( __( 'Newer Comments &raquo;', 'avia_framework' ) );
  194.             echo "</span>";
  195.             echo "</span>";
  196.         endif; // check for comment navigation
  197.    
  198.     echo "</div> <!-- end grid div-->";
  199.    
  200.    
  201.     else : // or, if we don't have comments:
  202.    
  203.     //do nothing
  204.    
  205.    
  206.  
  207. endif; // end have_comments()
  208.  
  209.  
  210.  
  211.      
  212.       ?>
  213.  
  214. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement