トップページ、カテゴリーページ、記事投稿ページ等に
「投稿日時」
「カテゴリーアーカイブ」
「コメントをどうぞ」
「←古い投稿」
「←前へ」
「次へ→」
をカットする事を検討しています。
スクリーンショットを取りました。
対象サイトは
http://dca-labo.info/demo8/
スクリーンショットのurlは下記です。
http://dca-labo.info/demo8/testimg/sample2.jpg
http://dca-labo.info/demo8/testimg/sample3.jpg
http://dca-labo.info/demo8/testimg/sample4.jpg
http://dca-labo.info/demo8/testimg/sample5.jpg
どのテンプレートをどのように修正するもか判りません。
ご教授頂ければと思います。
・トップページ「index.php」
ページナビゲーション(※「← 古い投稿」「新しい投稿 →」)を削除するには、ループの前と後を編集します。
<?php if ( have_posts() ) : ?> <?php twentyeleven_content_nav( 'nav-above' ); ?><!-- 上のページナビゲーションを削除する場合はここも削除します。 --> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?><!-- 「← 古い投稿」「新しい投稿 →」を削除するにはここを削除します。 --> <?php else : ?>
・「functions.php」
「投稿日時:」を削除するには、576行目以降にある「twentyeleven_posted_on()」の処理(※始まってすぐのspan要素ごと)を編集します。
if ( ! function_exists( 'twentyeleven_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * Create your own twentyeleven_posted_on to override in a child theme * * @since Twenty Eleven 1.0 */ function twentyeleven_posted_on() { printf( __( '<!-- ここのspan要素を削除またはコメントアウト <span class="sep">Posted on </span> --><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); } endif;
・「content.php」
「コメントをどうぞ」を削除するには、75行目以降の次の箇所をそっくり削除します。
<?php if ( comments_open() ) : ?> <?php if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; // End if comments_open() ?>
※以前a-kuma3さんが回答したように、「<?php if ( comments_open() ) : ?>」を「<?php if ( 0 ) : ?>」に変更して残して置いても大丈夫です。
・カテゴリーページ「category.php」
「カテゴリーアーカイブ: 」を削除するには、17行目以降の次の記述を
<header class="page-header"> <h1 class="page-title"><?php printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
次のように変更します。
<header class="page-header"> <h1 class="page-title"><?php printf( '%s', '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
または次のように変更しても大丈夫です。
<header class="page-header"> <h1 class="page-title"><?php print( '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
ページナビゲーション(※「← 古い投稿」「新しい投稿 →」)を削除するには、上記のすぐ下29行目以降にあるループの前と後を編集します。
<?php twentyeleven_content_nav( 'nav-above' ); ?><!-- 上のページナビゲーションを削除する場合はここも削除します。 --> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?><!-- 「← 古い投稿」「新しい投稿 →」を削除するにはここを削除します。 -->
・個別投稿ページ「single.php」
投稿ナビゲーション(※「← 前へ」「次へ →」)を削除するには、ループの処理が始まってすぐの所にある次の記述をそっくり削除します。
<nav id="nav-single"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ) ); ?></span> <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></span> </nav><!-- #nav-single -->
※特に参考ページはありませんのでダミーのURLで失礼します。(http://q.hatena.ne.jp/)