• Resolved hazelbug

    (@hazelbug)


    Hi,
    Here is the site I am working on. I need to exclude certain pages, but I don’t know how to add it to the code.

    When I tried to alter the `<?php wp_list_pages(‘exclude=17,38’ ); ?>
    ` it messes up the page.

    The code looks a bit different so I tried to also add
    get_page_by_title('3x5 Rugs')->ID, to the code bc it looked like they were excluding certain pages that way.

    Here is the PHP Code

    <?php wp_head(); ?>
    </head>
    <body>
    	<div id="page">
    		<div id="header">
    			<div id="headerimg">
    				<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    				<div id="description"><?php bloginfo('description'); ?></div>
    				<div id="menu">
    					<ul>
    						<?php
    $page_ids = array(get_page_by_title('Mailing List')->ID,
                                                                                                                                                                    get_page_by_title('Newsletter')->ID);
    
    							$page_ids = join(', ', $page_ids);
    							$args = array('title_li' => '', 'exclude' => $page_ids);
    							wp_list_pages($args);
    						?>
    					</ul>
    				</div>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need Help with the Exclude code’ is closed to new replies.