I am creating a custom theme for wordpress, which will have a settings page. i am adding the option to exclude pages from the navigation, which will simply work on the page id separated by a ","
here is the code i have so far:
<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>
this works fine excluding just 1 page id. but when i try and exclude more than 1 id it doesn't work, only the first id in the text input will get excluded and the other remain visible.
any help would be greatly appreciated.
Dan
$exmenuitemscontains an array of page Ids? – Sheikh Heera Apr 9 '12 at 21:44'post__not_in' => $exmenuitemsbecause it's already an array. – Sheikh Heera Apr 9 '12 at 21:51showpostsshould contain an int value and it's deprecated, instead you should useposts_per_page, codex.wordpress.org/Class_Reference/… – Sheikh Heera Apr 9 '12 at 21:53