我正在为wordpress创建一个自定义主题,它将有一个设置页面。我添加了从导航中排除页面的选项,该选项只会对由“,”分隔的页面id起作用
以下是我目前掌握的代码:
<ul class="tabs">
<?php
$exmenuitems = get_option(\'exmenuitems\');
$recentPosts = new WP_Query();
$recentPosts->query (array (
\'post__not_in\' => array($exmenuitems),
\'post_type\' => \'page\',
\'showposts\' => $menuitems
));
while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<?php $slug = basename(get_permalink());?>
<li><a href="#<?php echo $slug; ?>"><?php the_title();?></a></li>
<?php endwhile; ?>
</ul>
仅排除1个页面id可以很好地工作。但当我尝试排除多个id时,它不起作用,只有文本输入中的第一个id被排除,而另一个id保持可见。任何帮助都将不胜感激。
丹