انجمن


نمایش داده نشدن نظرات یک پست  (۱ نوشته)

  • sendous

    آفلاین
    عضو
    تعداد نوشته‌ها: ۳
    # نوشته شده: ۱۱ سال پیش
    ۱۳ تیر ۱۳۹۱ - ۰۰:۴۲

    سلام.
    یه مشکلی در رابطه با بخش نظرات سایتم برام پیش اومده.
    وقتی کاربری میاد و کامنتی رو به یه پست اضافه می کنه. این کامنت اضافه شده به یه پست دیگه منتقل میشه و نمیدونم به کدوم پست میره.
    یه پست دارم که 11 نظر توش ثبت شده ولی 1 مورد از تمام این نظرات نشون داده میشه.
    ولی این مشکل تو قالبهای دیگه فک کنم وجود نداره !!!
    اینم کد فایل Comment:

    `<?php // Do not delete these lines
    if (!empty($_SERVER['SCRIPT_FILENAME']) && '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
    ?>

    <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','kubrick'); ?></p>

    <?php
    return;
    }
    }

    /* This variable is for alternating comment background */
    $oddcomment = ' ';
    ?>

    <div class="com">
    <br>
    <?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>

    <p>
    <?php _e('Enter your password to view comments.'); ?>
    </p>
    <?php return; endif; ?>

    <?php if ($comments) : ?>
    <div class="commentlist">
    <?php foreach ($comments as $comment) : ?>
    <li>
    <div>
    <div class="comment-author vcard"> <?php echo get_avatar( $comment, $size = '50' ); ?> <cite class="fn">
    <b><?php comment_author() ?></b>
    <span>در <?php comment_date(__('F jS, Y','kubrick')) ?> گفت:</span></cite><br />
    <?php comment_text() ?>

    </div>
    </li>
    <?php endforeach; ?>
    </div>
    <div style="clear: both;"></div>
    <div id="top"></div>
    <?php endif; ?>

    <?php if ( comments_open() ) : ?>
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p><?php printf(__('شما ابتدا باید <a href="%s">وارد شوید</a> تا بتوانید دیدگاهتان را ارسال کنید.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?></p>
    <?php else : ?>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comments">
    <?php if ( $user_ID ) : ?>
    <p><?php printf(__('وارد شده با نام %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('خارج شدن از این نام کاربری') ?>">
    <?php _e('خروج »'); ?>
    </a></p>
    <?php else : ?>
    <p>
    <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <label for="author">
    <?php _e('نام *'); ?>
    </label>
    <br /> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
    <label for="email">
    <?php _e('ایمیل *');?>
    </label>
    <?php endif; ?>
    <!--<p><small><strong>XHTML:</strong> <?php printf(__('شما از این تگ ها میتوانید استفاده کنید %s'), allowed_tags()); ?></small></p>-->
    <br /> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea>
    <br /> <input name="submit" type="submit" id="submit" tabindex="5" value="ارسال" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    </form>
    <?php endif; // If registration required and not logged in ?>
    <?php else : // Comments are closed ?>
    <p>
    <?php _e('متاسفانه دیدگاه این پست بسته شده است'); ?>
    </p>
    <?php endif; ?>
    </div>

    اینم آدرس یه نمونه از پست هایی که توش 11 تا نظر داده شده ولی یکیش نشون داده میشه : <a href="http://www.prolearn-vs.com/">

درباره‌ی این موضوع