kvex様
ご返信ありがとうございます。
リンクされていたcodexを見ましたが、ちょっと良くわからなかったので、
教えて頂けますか?
single.phpをコピーして、phpファイルの名前をsingle-product.php
を作成する際に、
日付表示に関わる部分を削除するんでしょうか?
ちなみに、下記がsingle.phpです。
‘<?php get_header(); ?>
<div class=”art-content-layout”>
<div class=”art-content-layout-row”>
<div class=”art-layout-cell art-content”>
<?php
get_sidebar(‘top’);
global $post;
if (have_posts()){
if (art_get_option(‘art_top_single_navigation’)) {
// previous_post_link | next_post_link
art_page_navigation(
array(
‘next_link’ => art_get_previous_post_link(‘« %link’),
‘prev_link’ => art_get_next_post_link(‘%link »’)
)
);
}
while (have_posts())
{
the_post();
art_post_wrapper(
array(
‘id’ => art_get_post_id(),
‘class’ => art_get_post_class(),
//’thumbnail’ => art_get_post_thumbnail(),
‘title’ => art_get_meta_option($post->ID, ‘art_show_post_title’) ? get_the_title() : ”,
‘before’ => art_get_metadata_icons(‘date’, ‘header’),
‘content’ => art_get_content(), // ‘content’ => ‘My post content’,
‘after’ => art_get_metadata_icons(”, ‘footer’)
)
);
comments_template();
}
if (art_get_option(‘art_bottom_single_navigation’)) {
// previous_post_link | next_post_link
art_page_navigation(
array(
‘next_link’ => art_get_previous_post_link(‘« %link’),
‘prev_link’ => art_get_next_post_link(‘%link »’)
)
);
}
} else {
art_404_content();
}
get_sidebar(‘bottom’);
?>
<div class=”cleared”></div>
</div>
<div class=”art-layout-cell art-sidebar1″>
<?php get_sidebar(‘default’); ?>
<div class=”cleared”></div>
</div>
</div>
</div>
<div class=”cleared”></div>
<?php get_footer();
‘
ちなみに、これをどうやって、カスタム投稿タイプの記事(製品)にのみ
反映させるのでしょうか?
わからないことだらけですいません。
宜しくお願いします。
そういうことです。日付の表示部分だけを無くしたものを
single-product.php
などとしてテーマディレクトリに置いてください。
カスタム投稿タイプを product としていれば(例えばですので、ご自分のカスタム投稿タイプに合わせてくださいね)その記事のシングる表示は自動的に上記 single-product.php が読み込まれます。特に設定は不要です。
kvex様
分かりやすいアドバイスありがとうございました。
おかげ様で、カスタム投稿タイプにて「投稿日時」が無事削除されました。
'id' => art_get_post_id(),
'class' => art_get_post_class(),
//'thumbnail' => art_get_post_thumbnail(),
'title' => art_get_meta_option($post->ID, 'art_show_post_title') ? get_the_title() : '',
'before' => art_get_metadata_icons('date', 'header'),
'content' => art_get_content(), // 'content' => 'My post content',
'after' => art_get_metadata_icons('', 'footer')
)
);
comments_template();
内の’date’を外すだけという簡単な作業でしたが、分からず困っていた所でした。
今後、wordpresssを会社のwebページとして活用してく為に、
カスタム投稿タイプは有用なものとして考えておりましたので、
非常に助かりました。
ありがとうございました。