• Resolved martinfamily2005

    (@martinfamily2005)


    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
    		}
    	}
    }
  • The topic ‘How to Exclude Pages – Mensa Theme’ is closed to new replies.