Advertisement
guigui82

WP - Weaver Xtreme Child - comments.php

Jul 10th, 2019
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 5.03 KB | None | 0 0
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3.     exit;
  4. } // Exit if accessed directly
  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 to weaverx_comment() which is
  11.  * located in the functions.php file.
  12.  *
  13.  * @package WordPress
  14.  * @subpackage Weaver X
  15.  * @since Weaver Xtreme 1.0
  16.  *
  17.  *    >>>> DO NOT EDIT THIS FILE <<<<
  18.  *
  19.  * Warning! DO NOT EDIT THIS FILE, or any other theme file! If you edit ANY theme
  20.  * file, all your changes will be LOST when you update the theme to a newer version.
  21.  * Instead, if you need to change theme functionality, CREATE A CHILD THEME!
  22.  *
  23.  *    >>>> DO NOT EDIT THIS FILE <<<< */
  24.  
  25.     /*COLLAPSE-O-MATIC - open close content*/
  26.     <span class="collapseomatic" title="comments" id="monkey1" >OPEN COMMENTS</span>
  27.     <span id="swap-comments" style="display: none;">CLOSE COMMENTS</span>
  28.    
  29.        
  30.     /*Collapse-o-matic - collapse comments*/
  31.     <span id="commentCollapse" class="collapseomatic">
  32.     <?php
  33.     if ( comments_open() ) :
  34.     comments_popup_link('Leave a comment ↓', '1 comment ↓', '% comments ↓');
  35.     endif;
  36.     ?>
  37.     </span>
  38.     <span id="swap-commentCollapse" class="collapseomatic" style="display: none;">Collapse ↑</span>
  39.     <?php edit_post_link('Edit →', '| ', '' ); ?></p>
  40.     <div class="content_collapse_wrapper"><div id="target-commentCollapse" class="collapseomatic_content force_content_collapse">
  41.     <?php comments_template( '', true ); ?>
  42.     </div></div>
  43.        
  44.        
  45.  
  46. if ( post_password_required() ) { ?>
  47.  
  48.     <p class="nopassword"><?php echo esc_html__( 'This post is password protected. Enter the password to view any comments.', 'weaver-xtreme' ); ?></p>
  49.     <?php
  50.     /* Stop the rest of comments.php from being processed,
  51.     * but don't kill the script entirely -- we still have
  52.     * to fully load the template.
  53.     */
  54.  
  55.     return;
  56. }
  57. ?>
  58.  
  59. <?php
  60. $c_counts = get_comment_count( get_the_ID() );
  61. $c_count = $c_counts['approved'];
  62. if ( comments_open() || ( $c_count > 0 && ! weaverx_getopt_checked( 'hide_old_comments' ) ) ) {
  63.     echo( "\t\t<hr class='comments-hr' />\n" );
  64.  
  65.     echo '<div id="comments">';
  66.     echo '<div id="target-collapsecomments" class="collapseomatic_content">';
  67.     weaverx_inject_area( 'precomments' );
  68.  
  69.     $ct_class = ( $c_count < 1 ) ? ' class="no-comments-made"' : '';
  70.     ?>
  71.     <header id="comments-title"<?php echo $ct_class; ?>>
  72.         <h3><?php echo apply_filters( 'weaverx_comments_title', esc_html__( 'Comments', 'weaver-xtreme' ) ); ?></h3>
  73.         <h4>
  74.             <?php printf( "<em>%s</em> &#8212; ", get_the_title() );
  75.             comments_number(); /* em-dash */ ?>
  76.         </h4>
  77.     </header>
  78.  
  79.     <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // are there comments to navigate through ?>
  80.         <nav id="comment-nav-above">
  81.             <h1 class="assistive-text"><?php echo esc_html__( 'Comment navigation', 'weaver-xtreme' ); ?></h1>
  82.             <div class="nav-previous"><?php previous_comments_link( apply_filters( 'weaverx_older_comments', esc_html__( '&larr; Older Comments', 'weaver-xtreme' ) ) ); ?></div>
  83.             <div class="nav-next"><?php next_comments_link( apply_filters( 'weaverx_newer_comments', esc_html__( 'Newer Comments &rarr;', 'weaver-xtreme' ) ) ); ?></div>
  84.         </nav>
  85.     <?php } // check for comment navigation ?>
  86.  
  87.     <ol class="commentlist">
  88.         <?php
  89.         /* Loop through and list the comments. Tell wp_list_comments()
  90.         * to use weaverx_comment() to format the comments.
  91.         * If you want to overload this in a child theme then you can
  92.         * define weaverx_comment() and that will be used instead.
  93.         * See weaverx_comment() in weaverx/functions.php for more.
  94.         */
  95.         wp_list_comments( array( 'callback' => 'weaverx_comment' ) );
  96.         ?>
  97.     </ol>
  98.  
  99.     <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  100.         <nav id="comment-nav-below">
  101.             <h1 class="assistive-text"><?php echo esc_html__( 'Comment navigation', 'weaver-xtreme' ); ?></h1>
  102.             <div class="nav-previous"><?php previous_comments_link( apply_filters( 'weaverx_older_comments', esc_html__( '&larr; Older Comments', 'weaver-xtreme' ) ) ); ?></div>
  103.             <div class="nav-next"><?php next_comments_link( apply_filters( 'weaverx_newer_comments', esc_html__( 'Newer Comments &rarr;', 'weaver-xtreme' ) ) ); ?></div>
  104.         </nav>
  105.     <?php endif; // check for comment navigation ?>
  106.  
  107.     <?php
  108.     if ( comments_open() ) {
  109.         comment_form();
  110.     }
  111.     weaverx_inject_area( 'postcomments' );
  112.     echo "</div></div><!-- #comments -->\n";
  113.     echo "<span class="collapseomatic" title="comments" id="collapsecomments" >OPEN COMMENTS</span";
  114.     echo "<span id="swap-collapsecomments" style="display: none;">CLOSE COMMENTS</span";
  115.  
  116. } elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) {
  117.     /* If there are no comments and comments are closed, let's leave a little note, shall we?
  118.     * But we don't want the note on pages or post types that do not support comments.
  119.     */
  120.     ?>
  121.     <p class="nocomments"><?php echo esc_html__( 'Comments are closed.', 'weaver-xtreme' ); ?></p>
  122.     <?php
  123. }
  124.  
  125. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement