TOPページの各投稿ごとに任意のコメント欄を表示させたい
-
http://ja.forums.wordpress.org/topic/1763?replies=2http://ja.forums.wordpress.org/topic/7420?replies=5
http://ja.forums.wordpress.org/topic/2496?replies=8を拝見し、実践してみたのですが、当方php初心者で分からないので質問させていただきます。
バージョンは3.1.3、テンプレートは「Pixiv Custom 2.1.5」を使用しています。
TOPページの各投稿ごとに任意のコメント欄を表示させたいのですが、このテンプレートのindex.phpに記述すると、エントリーの枠外に記述され、かつデフォルトのコメント欄になってしまいます。コード↓
<?php get_header(); ?> <?php $options = get_option('pixiv_options'); if ( $options['index_notice_enable'] ) { ?><div class="allround notice"><?php echo html_entity_decode($options['index_notice_content']); ?> </div> <?php } ?> <?php get_template_part('loop','index'); ?> <?php $withcomments = true; comments_template( '/index_comments.php' ); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
このテンプレートはloop_index.phpをindex.phpに読み込んでいるようで、そちらに記述してみてもコメント欄は表示されません。↓コード
<div id="main_col_inner"> <?php if (have_posts()): while (have_posts()): the_post(); ?> <?php $withcomments = true; comments_template( '/index_comments.php' ); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="title">" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h2> <div class="entry"> <?php $options = get_option('pixiv_options'); if ( $options['list_layout'] == 'full') { the_content(__('Read More »','pixiv')); } elseif ( $options['list_layout'] == 'thumbnail' ) { if ( has_post_thumbnail() ) { the_post_thumbnail( array(150,150),array('class' => 'alignleft') ); } the_excerpt(); } ?> <div class="clearfix"></div> <?php if ($options['list_layout'] != 'title' ) wp_link_pages(); ?> </div> <footer class="post_date"> "><?php the_time(__('M jS, Y','pixiv')); ?> </footer> </article> ・ ・ ・省略
単一記事の投稿single.phpには
<?php comments_template('',true); ?>
できちんとcomments.phpが呼び出されています。
どのファイルにどういう記述をすればよいのか、どなたかご教授いただけないでしょうか。
よろしくお願いいたします。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「TOPページの各投稿ごとに任意のコメント欄を表示させたい」には新たに返信することはできません。