رفتن به مطلب

مشکل در کامنت ها


dr-wp

پست های پیشنهاد شده

سلام

من کدهای زیر رو توی فایل فانکشین قرار دادم برای بخش کامنت ها ولی مشکلی که داره اینه که وقتی هر مطلبی رو قرار میدم یه نظر ثبت میشه که نام نویسنده عنوان محصول هست و لینک سایت هم آدرس اون پست

قضیه چیه؟


function bistscript_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>


<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', 'bistscript' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'bistscript' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;


//Check Whether the comment is a Respond or Not
global $wpdb;

$get_comment_ID = get_comment_ID();
$respond_query = "SELECT * FROM $wpdb->comments
WHERE comment_ID = {$get_comment_ID}";

$rsp = $wpdb->get_results($respond_query);




?>


<div class="comment row<?php foreach ($rsp as $rs) {

if($rs->comment_parent == 0) : echo ""; else : echo " replied"; endif;


} ?>" id="li-comment-<?php comment_ID(); ?>">


<div class="avatar-reply col">
<?php echo get_avatar( $comment, 100 ); ?>
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'پاسخ دهید', 'bistscript' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div>
<div class="comment-body">
<div class="comment-body-top row">
<a class="author" href="<?php comment_author_url(); ?>" rel="nofollow" title="مشاهده وب سایت <?php comment_author(); ?>"><?php comment_author(); ?></a>
<span class="date"><?php comment_date(__('F jS, Y','kubrick')) ?> </span>
</div>
<p id="comment-<?php comment_ID(); ?>" class="comment-texttt">

<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'bistscript' ); ?></p>
<?php endif; ?>
<section class="comment-content">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', 'bistscript' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->



</p><!-- #comment-## -->
</div>


</div>

<?php
break;
endswitch; // end comment_type check
}

function bistscript_comment_form( $args = array(), $post_id = null ) {
global $id;
if ( null === $post_id )
$post_id = $id;
else
$id = $post_id;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => '<input class="send-form-input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '"' . $aria_req . ' placeholder="نام و نام خانوادگی : ">',
'email' => '<input class="send-form-input" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '"' . $aria_req . ' placeholder="ایمیل : ">',
'url' => '<input class="send-form-input" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="وب سایت : ">',
);
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<textarea class="comment-texttt" id="comment" name="comment" aria-required="true" placeholder="متن : "></textarea>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',

'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
);
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
if ( comments_open( $post_id ) ) :
do_action( 'comment_form_before' ); ?>
<div id="respond">
<small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small>
<div style="position:relative;">
<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
<?php echo $args['must_log_in']; ?>
<?php do_action( 'comment_form_must_log_in_after' ); ?>
<?php else : ?>
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
<?php do_action( 'comment_form_top' ); ?>
<?php if ( is_user_logged_in() ) : ?>
<script>
$("#respond").addClass("comment-as-logged-in-user");
</script>
<?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
<?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?>
<?php else : ?>
<?php
do_action( 'comment_form_before_fields' );
foreach ( (array) $args['fields'] as $name => $field ) {
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
}
do_action( 'comment_form_after_fields' );
?>
<?php endif; ?>
<?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
<?php echo $args['comment_notes_after']; ?>
<p class="form-submit">
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="ارسال دیدگاه" class="send_comment_form_submit">
<?php comment_id_fields( $post_id ); ?>
</p>
<?php do_action( 'comment_form', $post_id ); ?>
</form>
<?php endif; ?>
</div>
</div><!-- #respond -->
<!-- www.20script.ir -->
<?php else : do_action( 'comment_form_comments_closed' ); endif; }?>

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...