WP problem - excluding pages in NavBar
Just wondering if any of you can help me. I've spent hours trying to figure this out, having messed it up so many times and with no help from the WP forums you're my only hope!
I have six pages on a site but want to exclude 1 of them from appearing on the NavBar but I'm unsure how to do it. I've tried using various 'exclude' type plugins but to no avail (I'm using the theme Studiopress if it helps).
I've located the following code but am unsure how to change it correctly. Assuming my pages are named 'one','two','three' etc and I want to exclude 'six' from the NavBar, how do I code it?
Here's what the code looks like (it seems odd to me!).....
<div id="nav">
<?php function get_the_pa_ges() {
global $wpdb;
if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
$these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
}
return $these_pages;
}
function list_all_pages(){
$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;
if (is_page($the_page_id)) {
$addclass = ' class="current_page"';
} else {
$addclass = '';
}
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}
return $output;
}
?>
<?php
if (is_home()) {
$addclass = ' class="current_page"';
} else {
$addclass = '';
}
echo "<li" . $addclass . "></li>"; //change 'home'
echo list_all_pages();?>
</ul>
How would I prevent page 'six' page appearing on the NavbBar?
Any help would be much appreciated.
-
IronMike -
[ 1 ] Thanks
{{ DiscussionBoard.errors[6607027].message }} -