CarlMartin10
07-03-2010, 03:47 AM
Not sure if anyone here knows enough about Wordpress to help me or not, but it is worth a shot. Thanks in advance.
I am trying to exclude a page in the nav menu on my site. I am using the Mensa Theme, and the
<?php wp_list_pages('exclude=17,38' ); ?>
Method is not working. Any ideas?
Here is some code from:
header.php
<!-- BEGIN header -->
<div id="header">
<div class="search">
<form action="<?php echo get_option('home'); ?>/">
<input type="text" name="s" id="s" value="<?php the_search_query(); ?>" />
<button type="submit">S</button>
</form>
</div>
<div class="logo">
<h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>
</div>
<ul>
<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
<?php dp_list_pages(); ?>
</ul>
<div class="break"></div>
</div>
<!-- END header -->
functions.php
# Displays a list of pages
function dp_list_pages() {
global $wpdb;
$querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page' ORDER BY $wpdb->posts.ID ASC";
$pageposts = $wpdb->get_results($querystr, OBJECT);
if ($pageposts) {
foreach ($pageposts as $post) {
?><li><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title; ?></a></li><?php
}
}
}
I am trying to exclude a page in the nav menu on my site. I am using the Mensa Theme, and the
<?php wp_list_pages('exclude=17,38' ); ?>
Method is not working. Any ideas?
Here is some code from:
header.php
<!-- BEGIN header -->
<div id="header">
<div class="search">
<form action="<?php echo get_option('home'); ?>/">
<input type="text" name="s" id="s" value="<?php the_search_query(); ?>" />
<button type="submit">S</button>
</form>
</div>
<div class="logo">
<h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>
</div>
<ul>
<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
<?php dp_list_pages(); ?>
</ul>
<div class="break"></div>
</div>
<!-- END header -->
functions.php
# Displays a list of pages
function dp_list_pages() {
global $wpdb;
$querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page' ORDER BY $wpdb->posts.ID ASC";
$pageposts = $wpdb->get_results($querystr, OBJECT);
if ($pageposts) {
foreach ($pageposts as $post) {
?><li><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title; ?></a></li><?php
}
}
}