###分からないこと
WordPressのコメント欄のナンバリングについてお聞きしたいです。
コチラのサイトを参考に作成しております。
comments.phpにある
wp_list_comments()をwp_list_comments('callback=gtcn_basic_callback')に変更すると書いてありますが
質問者のwp_list_comments()部分を探して発見したところ
wp_list_comments('callback=mytheme_comment')←すでにコールバックが埋まっている?状態でした。
このwp_list_comments('callback=gtcn_basic_callback')以外で番号が表示できる記述お分かりになられませんでしょうか?
宜しくお願い致します。
###03月13日追記
css
1body { 2 counter-reset: section; /* section のカウンタを 0 にセット */ 3} 4h1:before { 5 counter-increment: section; /* section カウンタを増加 */ 6 content: "Section " counter(section) ": "; /* カウンタを表示 */ 7} 8 9ol { 10 counter-reset: section; /* 各 ol 要素に新しいインスタンスの section カウンタを生成 */ 11 list-style-type: none; 12} 13li:before { 14 counter-increment: section; /* section カウンタのこのインスタンスのみ増加 */ 15 content: counters(section, ".") " "; /* "." で区切られた section カウンタのインスタンスの値を付加 */ 16}
php
1function mytheme_comment($comment, $args, $depth) { 2 $GLOBALS['comment'] = $comment; ?> 3 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> 4 <div id="comment-<?php comment_ID(); ?>"> 5 6 <div class="comment-listCon"> 7 <div class="comment-info"> 8 9 <?php printf(__('<cite class="fn comment-author">%s<span class="admin"></span></a></cite> '), get_comment_author_link()) ?> 10 <?php printf(__('%1$s at %2$s'), get_comment_date('Y/m/d(D)'), get_comment_time('H:i')) ?> 11 <?php edit_comment_link(__('Edit'),' ','') ?> 12 </div> 13 <?php if ($comment->comment_approved == '0') : ?> 14 <em><?php _e('Your comment is awaiting moderation.') ?></em> 15 <?php endif; ?> 16 <div class="come_te"> 17 <?php comment_text() ?> 18 </div> 19 <div class="reply"> 20 <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 21 </div> 22 </div> 23</div> 24<?php 25}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/13 05:47
退会済みユーザー
2018/03/13 09:41
2018/03/13 09:50