Advertisement
guigui82

WP - Weaver Xtreme Child - comments.php - 110719

Jul 11th, 2019
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.41 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.     <span class="collapseomatic" title="comments" id="monkey1" >OPEN COMMENTS</span>
  26.     <span id="swap-comments" style="display: none;">CLOSE COMMENTS</span>
  27.  
  28.  
  29.  
  30. if ( post_password_required() ) { ?>
  31.  
  32.     <p class="nopassword"><?php echo esc_html__( 'This post is password protected. Enter the password to view any comments.', 'weaver-xtreme' ); ?></p>
  33.     <?php
  34.     /* Stop the rest of comments.php from being processed,
  35.     * but don't kill the script entirely -- we still have
  36.     * to fully load the template.
  37.     */
  38.  
  39.     return;
  40. }
  41. ?>
  42.  
  43. <?php
  44. $c_counts = get_comment_count( get_the_ID() );
  45. $c_count = $c_counts['approved'];
  46. if ( comments_open() || ( $c_count > 0 && ! weaverx_getopt_checked( 'hide_old_comments' ) ) ) {
  47.     echo( "\t\t<hr class='comments-hr' />\n" );
  48.  
  49.     echo '<div id="comments">';
  50.     echo '<div id="target-collapsecomments" class="collapseomatic_content">';
  51.     weaverx_inject_area( 'precomments' );
  52.  
  53.     $ct_class = ( $c_count < 1 ) ? ' class="no-comments-made"' : '';
  54.     ?>
  55.     <header id="comments-title"<?php echo $ct_class; ?>>
  56.         <h3><?php echo apply_filters( 'weaverx_comments_title', esc_html__( 'Comments', 'weaver-xtreme' ) ); ?></h3>
  57.         <h4>
  58.             <?php printf( "<em>%s</em> &#8212; ", get_the_title() );
  59.             comments_number(); /* em-dash */ ?>
  60.         </h4>
  61.     </header>
  62.  
  63.     <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // are there comments to navigate through ?>
  64.         <nav id="comment-nav-above">
  65.             <h1 class="assistive-text"><?php echo esc_html__( 'Comment navigation', 'weaver-xtreme' ); ?></h1>
  66.             <div class="nav-previous"><?php previous_comments_link( apply_filters( 'weaverx_older_comments', esc_html__( '&larr; Older Comments', 'weaver-xtreme' ) ) ); ?></div>
  67.             <div class="nav-next"><?php next_comments_link( apply_filters( 'weaverx_newer_comments', esc_html__( 'Newer Comments &rarr;', 'weaver-xtreme' ) ) ); ?></div>
  68.         </nav>
  69.     <?php } // check for comment navigation ?>
  70.  
  71.     <ol class="commentlist">
  72.         <?php
  73.         /* Loop through and list the comments. Tell wp_list_comments()
  74.         * to use weaverx_comment() to format the comments.
  75.         * If you want to overload this in a child theme then you can
  76.         * define weaverx_comment() and that will be used instead.
  77.         * See weaverx_comment() in weaverx/functions.php for more.
  78.         */
  79.         wp_list_comments( array( 'callback' => 'weaverx_comment' ) );
  80.         ?>
  81.     </ol>
  82.  
  83.     <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  84.         <nav id="comment-nav-below">
  85.             <h1 class="assistive-text"><?php echo esc_html__( 'Comment navigation', 'weaver-xtreme' ); ?></h1>
  86.             <div class="nav-previous"><?php previous_comments_link( apply_filters( 'weaverx_older_comments', esc_html__( '&larr; Older Comments', 'weaver-xtreme' ) ) ); ?></div>
  87.             <div class="nav-next"><?php next_comments_link( apply_filters( 'weaverx_newer_comments', esc_html__( 'Newer Comments &rarr;', 'weaver-xtreme' ) ) ); ?></div>
  88.         </nav>
  89.     <?php endif; // check for comment navigation ?>
  90.  
  91.     <?php
  92.     if ( comments_open() ) {
  93.         comment_form();
  94.     }
  95.     weaverx_inject_area( 'postcomments' );
  96.     echo "</div></div><!-- #comments -->\n";
  97.     echo "span class="collapseomatic" title="comments" id="collapsecomments" >OPEN COMMENTS</span>";
  98.     echo "<span id="swap-collapsecomments" style="display: none;">CLOSE COMMENTS</span>";
  99.  
  100. } elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) {
  101.     /* If there are no comments and comments are closed, let's leave a little note, shall we?
  102.     * But we don't want the note on pages or post types that do not support comments.
  103.     */
  104.     ?>
  105.     <p class="nocomments"><?php echo esc_html__( 'Comments are closed.', 'weaver-xtreme' ); ?></p>
  106.     <?php
  107. }
  108. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement