サポート » 使い方全般 » category.phpの記事表示をsingle.phpにあわせたい

  • テーマ:Twenty Twelve  バージョン 1.3です。

    category.phpをそれぞれのカテゴリー別に画像タイトルを表示させるの中で、
    カテゴリー内の記事一覧で表示される個々の記事のタイトルや日付の表示を、
    single.phpにあわせたいのですが、何処で設定をすればよいでしょうか?

    現状ですと、記事タイトル、記事本文、その下に
    「カテゴリー: お知らせ, ○○○○ | 投稿日: ○○○○年○○月○○日 | 投稿者:○○ 編集」
    と表示されています。

    どこかにcategory.php内の記事個々の表示を制御するファイルがあるのでしょうか?
    宜しくお願いいたします。

    ◆category.php内の記事表示部分

    <section id="primary" class="site-content">
    		<div id="content" role="main">
    
    		<?php if ( have_posts() ) : ?>
    
    			<?php
    			/* Start the Loop */
    			while ( have_posts() ) : the_post();
    
    				/* Include the post format-specific template for the content. If you want to
    				 * this in a child theme then include a file called called content-___.php
    				 * (where ___ is the post format) and that will be used instead.
    				 */
    				get_template_part( 'content', get_post_format() );
    
    			endwhile;
    
    			twentytwelve_content_nav( 'nav-below' );
    			?>
    
    		<?php else : ?>
    			<?php get_template_part( 'content', 'none' ); ?>
    		<?php endif; ?>
    
    		</div><!-- #content -->
    	</section><!-- #primary -->

    ◆category.php内の個々の記事に付けたい single.php内の記事タイトル表示部分

    <div class="contents_title">
          <h3><?php the_title(); ?></h3>
          <p><?php the_time('Y年m月j日') ?></p>
        </div>
        <div class="contents_staff">
          <p><img src="http://*******/images/contents/staff_00.jpg" width="60" height="60" /></p>
          <p>スタッフ<br />○○○</p>
        </div>
1件の返信を表示中 - 1 - 1件目 (全1件中)
  • こんにちは

    get_template_part( 'content', get_post_format() );

    この部分がcategory.phpで各投稿のテンプレートファイルを呼び出している部分です。

    投稿フォーマットを使っていなければcontent.phpというテンプレートを使って、それぞれの投稿を表示します。

    single.phpで、同じ関数が使われていない場合は、直書きになっていると思いますので、テンプレートと、content.phpを見比べならが、変更する事になると思います。

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「category.phpの記事表示をsingle.phpにあわせたい」には新たに返信することはできません。