kira.kurashikaizen
フォーラムへの返信
-
フォーラム: 使い方全般
返信が含まれるトピック: 関連記事がプラグインで表示されない件追加ですみません。どうしても解決せず、お力添えを願います。
やはり、関連記事が、プレビュー以外では表示されません。
こちらのサイトになります。http://kurashikaizen.sakura.ne.jp/1/
single.phpは、下記の通りです。(minimal wp)
<?php get_header(); ?> <!-- メインwrap --> <div id="main-wrap"> <!-- メインカラム --> <div id="main-single"> <h2 class="pagetitle"><?php the_category(' / '); ?></h2> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h3 class="blog-title" id="post-<?php the_ID(); ?>"> <div id="date"><?php the_time(__('Y/m/d')) ?></div> </a><a>"><?php the_title(); ?></a> </h3> <?php the_content(); ?> <div id="blog-foot"> <span class="left" ><a>" title="RSSリーダーに登録" target="_blank"><img src="<?php bloginfo('template_directory');?>/images/icon_rss.gif" alt="RSS Feed" /></a></span> <?php the_tags(__('Tags:', 'kubrick'), ', ', ''); ?> <?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </div> <!-- ページャー --> <div id="next"> <span class="left"><?php previous_post_link('%link', '< %title', 'true'); ?></span> <span class="right"><?php next_post_link('%link', '%title >', 'true'); ?></span> <div class="clear"></div> </div> <!-- / ページャー --> <!-- 関連記事 --> <h3 class="similar-head">Related Posts</h3> <?php $original_post = $post; $tags = wp_get_post_tags($post->ID); $tagIDs = array(); if ($tags) { $tagcount = count($tags); for ($i = 0; $i < $tagcount; $i++) { $tagIDs[$i] = $tags[$i]->term_id; } $args=array( 'tag__in' => $tagIDs, 'post__not_in' => array($post->ID), 'showposts'=>5, 'ignore_sticky_posts'=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <ul class="similar"> <li><a>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> <?php endwhile; wp_reset_query(); ?> <?php } else { ?> 関連する記事はありません <?php } } ?> <!-- / 関連記事 --> <p> </p> <!-- コメントエリア --> <?php comments_template(); ?> <!-- / コメントエリア --> <?php endwhile; else: ?> <p><?php echo "お探しの記事、ページは見つかりませんでした。"; ?></p> <?php endif; ?> </div> <!-- / メインカラム --> <?php get_sidebar(); ?> </div> <!-- / メインwrap --> <?php get_footer(); ?>
フォーラム: 使い方全般
返信が含まれるトピック: 広告などの変更がすぐに反映されない本当にありがとうございます!!すべて解決しました!
表示に15分以上かかるとはつゆ知らず、トラブルだと思い込んでいました。
それで、別の方法を試してみたりして、重複していたようです。
本当に助かりました。
こんなに早く回答頂いて、感謝しております。
お忙しい中ありがとうございました。