トップページ「front_page」の投稿日の表示を消す方法(ビジネスサイト編)

この記事には広告を含む場合があります。

記事内で紹介する商品を購入することで、当サイトに売り上げの一部が還元されることがあります。

ビジネスサイト(ショップやコーポレートサイトなどのホームページ)のトップページの下部に
表示されている投稿日「 この投稿は〇〇〇〇年〇〇月〇〇日。」を削除する方法
※ テーマTwentyTwelveをベースにビジネスサイト化してますので、テーマによって若干
 異なる場合があります。

「外観」から「テーマ編集」よりcontent.phpを以下のように変更します。

※ ブログ投稿の場合は表示させたいので、トップページのみを投稿日を表示させないようにしています。

変更前

ディフォルト時(投稿日表示)

		<footer class="entry-meta">
			<?php twentytwelve_entry_meta(); ?>
			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
			<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>

変更後

投稿日を表示させない

		<footer class="entry-meta">
			<?php if ( is_front_page() ) : ?>
			<?php else : ?>
			<?php twentytwelve_entry_meta(); ?>
			<?php endif; ?>
			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
			<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>