So most Wordpress themes will use
<?php wp_list_pages();?>
to pull the pages for the navigation bar. I know that if I use
<?php wp_list_pages('exclude=17,38');?> Pages 17 & 18 won't show.
So here's the issue...my theme uses
<?php dp_list_pages();?> And when I try to put the exclusion in there, it
completely jacks my whole theme and nothing works. I've gone into the functions.php
file and here's the associated code with the dp_list_pages
# 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.post_title 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 can't figure out for my life how to simply exclude two pages I don't want to show in the nav bar. I had a plugin running called exclude pages, but it only works with themes that have the wp_list_pages code. This is starting to piss me off. Anyone have an idea or two? Thanks.
<?php wp_list_pages();?>
to pull the pages for the navigation bar. I know that if I use
<?php wp_list_pages('exclude=17,38');?> Pages 17 & 18 won't show.
So here's the issue...my theme uses
<?php dp_list_pages();?> And when I try to put the exclusion in there, it
completely jacks my whole theme and nothing works. I've gone into the functions.php
file and here's the associated code with the dp_list_pages
# 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.post_title 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 can't figure out for my life how to simply exclude two pages I don't want to show in the nav bar. I had a plugin running called exclude pages, but it only works with themes that have the wp_list_pages code. This is starting to piss me off. Anyone have an idea or two? Thanks.