سعید شعبانی 2047 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 سلامبخش کامنت قالب من به صورت wp_list_comments هست و داخل فایل فانکشن بخش مربوط به نظرات به صورت زیر هست. اما مشکلی که وجود داره این هست که پینگ پست هایی که پینگ دارند را نشون نمیده باید چیکار کنم؟<?phpfunction mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; }?> <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>"> <?php if ( 'div' != $args['style'] ) : ?> <div id="div-comment-<?php comment_ID() ?>" class="comment-body"> <?php endif; ?> <div class="comment-author vcard"> <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?> <?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?> <?php the_time('d M Y'); ?> <?php if ($comment->comment_approved == '0') : ?> <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em> <?php endif; ?> <a class="comment-link" href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">#</a> <div class="reply"> <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> <div class="comment-text <?php/* Only use the adminComment class from style.css if the user_id is 1 (admin) */if (1 == $comment->user_id)$oddcomment = "adminComment";echo $oddcomment;?>"> <?php comment_text() ?> </div> <?php if ( 'div' != $args['style'] ) : ?> </div> <?php endif; ?><?php } نقل قول لینک به ارسال
mehral 785 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 (ویرایش شده) فکر کنم این جواب میده<?phpfunction mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <p><?php _e( 'Pingback:'); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)' ), '<span class="edit-link">', '</span>' ); ?></p> <?php break; default : extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; }?> <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>"> <?php if ( 'div' != $args['style'] ) : ?> <div id="div-comment-<?php comment_ID() ?>" class="comment-body"> <?php endif; ?> <div class="comment-author vcard"> <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?> <?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?> <?php the_time('d M Y'); ?> <?php if ($comment->comment_approved == '0') : ?> <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em> <?php endif; ?> <a class="comment-link" href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">#</a> <div class="reply"> <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> <div class="comment-text <?php/* Only use the adminComment class from style.css if the user_id is 1 (admin) */if (1 == $comment->user_id)$oddcomment = "adminComment";echo $oddcomment;?>"> <?php comment_text() ?> </div> <?php if ( 'div' != $args['style'] ) : ?> </div> <?php endif; ?><?phpbreak; endswitch; // end comment_type check} ویرایش شده تیر 92 توسط mehral 3 نقل قول لینک به ارسال
سعید شعبانی 2047 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 نه این هم جواب نمیده نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 پینگ توی مدیریت فعال شده؟ نقل قول لینک به ارسال
سعید شعبانی 2047 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 پینگ توی مدیریت فعال شده؟بله فعال هست نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 اینجا با مثال توضیح داده:http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/wordpress-how-to-separate-comments-from-trackbacks-pingbacks-using-wp_list_comments-function/ 2 نقل قول لینک به ارسال
سعید شعبانی 2047 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 اینجا با مثال توضیح داده:http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/wordpress-how-to-separate-comments-from-trackbacks-pingbacks-using-wp_list_comments-function/اینجوری که باید دوباره بخش کامنت ها رو بسازم و استایلش بدم. من فقط می خواهم تا پینگ ها بین نظرات برحسب تاریخ درج قرار بگیرند. نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 با این بخش کد هم تست کردید؟<!-- PINGS (TRACKBACKS & PINGBACKS) SECTION --><?php//If there are No pings, don't display the header and the navigation. One reason is that get_comment_pages_count() function is used to calculate the//total number of comments pages. It does not separate for pings. So when the count is 0, the navigation still shows and it mimics the comments//section. Second reson if there are no Pings, then why display the header. if ((get_comments_number() - comments_only_count($count)) > 0) { echo '<h3 id="comments-title">'; printf( _n( 'One Ping to %2$s', '%1$s Pings to %2$s', get_comments_number() - comments_only_count($count), 'twentyten' ), number_format_i18n( get_comments_number() - comments_only_count($count) ), '<em>' . get_the_title() . '</em>' ); echo '</h3>'?> <ol class="commentlist"> <?php wp_list_comments('type=pings&callback=twentyten_comment'); ?> </ol> <?php //get_pings_pages_count() is a custom function that must be added to 'functions.php' file. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there Comments to navigate through? ?> <div class="navigation"> <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Pings', 'twentyten' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Pings <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- .navigation --> <?php endif; // check for comment navigation ?><?php } ?> نقل قول لینک به ارسال
سعید شعبانی 2047 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 با این بخش کد هم تست کردید؟<!-- PINGS (TRACKBACKS & PINGBACKS) SECTION --><?php//If there are No pings, don't display the header and the navigation. One reason is that get_comment_pages_count() function is used to calculate the//total number of comments pages. It does not separate for pings. So when the count is 0, the navigation still shows and it mimics the comments//section. Second reson if there are no Pings, then why display the header.if ((get_comments_number() - comments_only_count($count)) > 0) {echo '<h3 id="comments-title">';printf( _n( 'One Ping to %2$s', '%1$s Pings to %2$s', get_comments_number() - comments_only_count($count), 'twentyten' ),number_format_i18n( get_comments_number() - comments_only_count($count) ), '<em>' . get_the_title() . '</em>' );echo '</h3>'?><ol class="commentlist"> <?php wp_list_comments('type=pings&callback=twentyten_comment'); ?></ol><?php //get_pings_pages_count() is a custom function that must be added to 'functions.php' file. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there Comments to navigate through? ?> <div class="navigation"> <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Pings', 'twentyten' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Pings <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- .navigation --> <?php endif; // check for comment navigation ?><?php } ?>اینو توی comments.php بگذارم؟ نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 بلهبزاردی و ببینید تعداد پینگ یا ترک رو نمایش میده؟ نقل قول لینک به ارسال
سعید شعبانی 2047 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 گذاشتم ارور میده نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 چه خطایی میده؟ نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .