aminq10 50 ارسال شده در اردیبهشت 96 گزارش بازنشر ارسال شده در اردیبهشت 96 درود دوستان من از کد زیر برای فایل comments.php استفاده میکنم! مشکل این هست که وقتی نظر جدید ثبت میشه نه در قسمت ادمین میاد و نه در قالب اما نظرات قبلی نشون داده میشه مشکلی نداره! <?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 ( post_password_required() ) { ?> <p class="nocomments">این مطلب خصوصی است.در صورتی که رمز آن را دارید در قسمت زیر وارد کنید.</p> <?php return; } ?> <!-- You can start editing here. --> <div class="commentlistbk" > <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12"> <?php if ( have_comments() ) : ?> <div class="navigation"> <div class="alignleft"><?php previous_comments_link() ?></div> <div class="alignright"><?php next_comments_link() ?></div> </div> <?php wp_list_comments('avatar_size=96&type=comment'); ?> <div class="navigation"> <div class="alignleft"><?php previous_comments_link() ?></div> <div class="alignright"><?php next_comments_link() ?></div> </div> <?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; ?> </div> <?php if ('open' == $post->comment_status) : ?> <div id="respond"> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p>شما باید <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">وارد سایت شوید</a> تا بتوانید نظر دهید.</p> <?php else : ?> <div class="advert-comment" > <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" class="commentform" > <?php if ( $user_ID ) : ?> <?php else : ?> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6"> <p> <label for="author"> <small><i class="fa fa-address-card fa-1x" aria-hidden="true"></i> نام<?php if ($req) echo ""; ?></small></label></p><p><input class="commentlabel" type="text" name="author" id="author" value="<?php echo $comment_author; ?>"tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> </p> </div> <div class="col-xs-12 col-sm-6 col-md-6"> <p> <label for="email"><small><i class="fa fa-envelope fa-1x" aria-hidden="true"></i> ایمیل<?php if ($req) echo ""; ?> </small></label></p><p><input class="commentlabel" type="text" style="text-align:left" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> </p> </div> </div> <?php endif; ?> <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>--> <p> <label for="email"><small><i class="fa fa-comments-o" aria-hidden="true"></i> نظر خود را بیان کنید!<?php if ($req) echo ""; ?> </small></label></p> <p><textarea name="comment" class="comment" id="comment" rows="10" tabindex="3" ></textarea></p> <p><input name="submit" class="btn btn-default" type="submit" tabindex="4" value="ثبت نظر" /> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', $post->ID); ?> </form> </div> <?php endif; // If registration required and not logged in ?> </div> <?php endif; // if you delete this the sky will fall on your head ?> </div> </div> لینک به ارسال
Morteza 34190 ارسال شده در خرداد 96 گزارش بازنشر ارسال شده در خرداد 96 کدتون رو کلی نگاه کردم بنظر مشکلی نداره. ولی میتونید از کدهای بخش دیدگاه یکی از پوسته های پیش فرض وردپرس استفاده کنید. 2 لینک به ارسال
پست های پیشنهاد شده
لطفا برای ارسال دیدگاه وارد شوید
شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید
ورود به حساب کاربری