رفتن به مطلب

درخواست راهنمایی برای تکمیل قسمت دیدگاه قالب


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

با سلام به دوستان عزیز

بنده در حال آماده سازی یک قالب هستم که در بخش دیدگاه گیر کردم

بخش دیدگاه به لحاظ ظاهر درسته ، ولی زمانی که فرم پر میشه پیغام "پس از تایید مدیریت نمایش داده نمیشه"

و برای اون کاربر این نوشته نمیاد

ضمن اینکه گزینه پاسخ هم درست عمل نمیکنه

و بعضا دیدگاه های ثبت شده نمایش داده نمیشه

کد فایل COMMENT و قسمت فانکشن رو هم میزارم تا دوستان بررسی بهتری داشته باشند

پیشاپیش ممنون

فایل کامنت


<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<h2><?php _e('Password Protected'); ?></h2>
<p><?php _e('Enter the password to view comments.'); ?></p>
<?php return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'alt';
?>
<!-- You can start editing here. -->
<?php if ($comments) : ?>

<ol class="commentlist">
<?php wp_list_comments("type=comment&callback=mytheme_comment"); ?>
</ol>

<?php /* Changes every other comment to a different class */
if ('alt' == $oddcomment) $oddcomment = '';
else $oddcomment = 'alt';
?>

<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">امکان ارسال نظر وجود ندارد</p>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>


<div class="user_ID"><?php cancel_comment_reply_link(); ?></div>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
برای ارسال نظر لطفا ابتدا <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">وارد شوید</a> <?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<div class="user_ID">
شما با نام کاربری <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> وارد شده اید. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="خارج شدن">خارج می شوید ؟ »</a></div>
<?php else : ?>
<div class="sendcomment">
<h3><i class="fa fa-comment"></i>شما هم دیدگاه خود را ارسال کنید</h3>
<form>
<div class="rightsend">
<input name="author" type="text" placeholder="  نام شما">
<input name="email"type="email" placeholder="  آدرس ایمیل">
<input name="url" type="url" placeholder="  وبسایت">
<input type="submit" value="  ارسال دیدگاه">
</div>
<?php endif; ?>
<textarea name="comment" rows="5" id="textarea" placeholder=" متن پیام شما ..."></textarea>
</div>


<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>

فانکشن


<?php
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'reply_text' => $reply_text ,'max_depth' => $args['max_depth']))) ?>
<div class="commentbox">
<div class="rightcommentcl">
<?php echo get_avatar($comment,$size='50' ); ?>
<?php $reply_text = "پاسخ" ?>
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'reply_text' => $reply_text ,'max_depth' => $args['max_depth']))) ?>
</div>
<div class="titlecomment">
<?php printf(__('%s '), get_comment_author_link()) ?>
در تاریخ
<?php comment_date(__('l d F Y ','kubrick')) ?>
گفته است:
</div>
<?php comment_text() ?>
<div class="clear"></div></div>
<?php if ($comment->comment_approved == '0') : ?>
<?php _e(' نظر شما منتظر تاييد مديريت سايت است.'); ?>
<?php endif; ?>
<?php
}
?>

نکته دیگه اینکمه هنگام ارسال کامنت ، دوباره ابتدای صفحه اسکرول میشه.

لینک به ارسال

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

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

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

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

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

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

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

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

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