if (is_post_navi_visible()) { //「前の記事」「次の記事」を表示するか if (is_post_navi_type_default()) { //「前の記事」「次の記事」ナビタイプはデフォルトか get_template_part('pager-post-navi'); //デフォルトナビのテンプレート } else { //「前の記事」「次の記事」ナビタイプはサムネイルか get_template_part('pager-post-navi-thumbnail'); //サムネイルナビのテンプレート } } ?> <?php if (is_comments_visible()) { //コメント・コメント欄を表示するか comments_template(); //コメントテンプレート } ?> </section> <?php } // 繰り返し処理終了 } else { // ここから記事が見つからなかった場合の処理 ?> <div class="post"> <h2>NOT FOUND</h2> <p><?php
<?php if (is_category_visible() && get_the_category()) { //投稿ページの場合 ?> <span class="category"><span class="fa fa-folder fa-fw"></span><?php the_category(', '); ?> </span> <?php } //is_category_visible ?> <?php //コメント数を表示するか if (is_comments_visible() && is_list_comment_count_visible()) { $comment_count_anchor = get_comments_number() > 0 ? '#comments' : '#reply-title'; ?> <span class="comments"> <span class="fa fa-comment"></span> <span class="comment-count"> <a href="<?php echo get_the_permalink() . $comment_count_anchor; ?> " class="comment-count-link"><?php echo get_comments_number(); ?> </a> </span> </span> <?php