Site icon Hip-Hop Website Design and Development

Attempting to get property of non-object notices in comment-template.php

I want some customization of WORDPRESS remark space, so I’ve used this code in my little one theme :

    <div id="feedback" class="x-comments-area">

    <?php if ( have_comments() ) : ?>

    <?php
    //The writer of present put up
    $author_ID = get_the_author_meta("ID");
    //The present put up ID
    $p_ID = get_the_ID();
    ?>

    <h2 class="h-comments-title"><span><?php _e( 'Feedback' , '__x__' ); ?>  <small>
    <?php 
    //Variety of visitor feedback
    echo ztjalali_persian_num(number_format_i18n(depend(get_comments(array('post_id' => $p_ID,'author__not_in' => array($author_ID))))));
 ?></small></span></h2>
    <ol class="x-comments-list">
    <?php
    wp_list_comments( array(
    'callback' => 'x_icon_comment',
    'type'    => 'ol'
  ) );
  ?>
    </ol>

    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    <nav id="comment-nav-below" class="navigation" function="navigation">
    <h1 class="visually-hidden"><?php _e( 'Remark navigation', '__x__' ); ?></h1>
    <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Feedback', '__x__' ) ); ?></div>
    <div class="nav-next"><?php next_comments_link( __( 'Newer Feedback &rarr;', '__x__' ) ); ?></div>
    </nav>
    <?php endif; ?>

    <?php if ( ! comments_open() && get_comments_number() ) : ?>
    <p class="nocomments"><?php _e( 'Feedback are closed.' , '__x__' ); ?></p>
    <?php endif; ?>

    <?php endif; ?>

    <?php
//Loading of smilies
    ob_start(); cs_print_smilies(); $cs_print_smilies = ob_get_clean();
//Remark type re-arrangement
    comment_form( array(
    'comment_notes_before' => '',
    'comment_notes_after'  => '',
    'id_submit'            => 'entry-comment-submit',
    'label_submit'         => __( 'Submit' , '__x__' ),
    'title_reply'          => __( '<span>Depart a Remark</span>' , '__x__' ),
    'fields'               => array(
    'writer' =>
    '<p class="comment-form-author">' .
    '<enter id="writer" identify="writer" kind="textual content" worth="' . get_comment_author()  . '" placeholder="' . __( 'Title *', '__x__' ) . ' ' . '" dimension="30"/>' .
    '</p>',
    'e-mail'  =>
    '<p class="comment-form-email">' .

      '<enter id="e-mail" identify="e-mail" kind="e-mail" aria-required="true" aria-invalid="false" worth="' .get_comment_author_email() . '" placeholder="' . __( 'E mail *', '__x__' ) . ' ' . '" dimension="30"/>' .
    '</p>',
    'url'    =>
    '<p class="comment-form-url">' .

      '<enter id="url" identify="url" kind="textual content" worth="' . get_comment_author_url() . '" placeholder="' . __( 'URL', '__x__' ) . '" dimension="30" />' .
    '</p>'
),
    'comment_field' => '<p class="comment-form-comment">' .
                     '</br>'.
                      $cs_print_smilies .
                     '<textarea id="remark" identify="remark" cols="45" rows="4" placeholder="' . _x( 'Remark *', 'noun', '__x__' ) . '" aria-required="true"></textarea>' .
                   '</p>'

) );
?>

    </div>

However with utilizing above code I’ll have these PHP notices in my revealed posts, above the feedback space:

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 28

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 46

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 97

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 97

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 296

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 296

Discover: Attempting to get property of non-object in /dwelling/foo/public_html/wp-includes/comment-template.php on line 309

Whereas I do know the issue just isn’t within comment-template.php file.

How might I eliminate them?