WordPress で特定の投稿を表示しないようにしようとしていますが、表示しないように指示している投稿がまだ表示されているようです。私は現在、このコードを持っています:
<?php
if (have_posts()) : while (have_posts()) : the_post();
if (in_array($post->ID, $_SESSION['save_array_posts'])) continue;
?>
<div class="yl_bg_post main_content videos">
<h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_content('<p class="more">More></p>'); ?>
</div>
<?php endwhile; endif; ?>
そして、WordPress に保存されている特定の投稿を表示しないようにしようとしています$_SESSION['save_array_posts']
。値は次のとおりです。
array(5) { [0]=> int(190) [1]=> int(199) [2]=> int(63) [3]=> int(66) [4]=> int(68) }
WordPress がループしてまだ表示されているようですが、その理由はよくわかりません。