WordPress.org

Forums

[resolved] exclude a page from the menu (5 posts)

  1. caladan
    Member
    Posted 2 years ago #

    hi there,
    i try to exclude a page from the menu. since i have a custom made theme, i cant get the "exclude" option to work and diddnt find help by searching:

    the code is:

    <?php 
    
    	// content
    	if ( have_posts() ) while ( have_posts() ) : the_post();
    	the_content();
    	endwhile;
    
    	// list sub pages
    	echo '<ul class="arrow">';
    	wp_list_pages('title_li=&child_of='.get_the_id());
    	echo '</ul>';
    ?>

    where can i fit in the "exclude=123" option?

    thanks for your help!!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    wp_list_pages('title_li=&exclude=23&child_of='.get_the_id());

  3. caladan
    Member
    Posted 2 years ago #

    mhm, i tryed this, but the page still appears in the menu.
    its a sidescrolling theme where i cant write articles, only create pages. could there be another part of code that needs to be changed?

    i have no idea, but it doesnt work like that.

    thanks esmi!

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Are you sure that you have the correct page id?

  5. caladan
    Member
    Posted 2 years ago #

    ah, i got it. the page id was right, the page just used a wrong style sheet. it works now with the code above.

    thanks so much!!

Topic Closed

This topic has been closed to new replies.

About this Topic