In wordpress, when I create a page, it automatically puts a link to it in the menu of the site. Is there anyway to stop wordpress automatically creating these links?
It is actually your theme that is creating these links. Anyway, go to your themes folder (wp-content/themes/themename/) and open up the header.php file. In it you will find a line that says wp_list_pages('parameters') [it won't actually say parameters, thats just where they are] All you have to do is go to the end of the parameters and add "&exclude=p1,p2" replacing p1 and p2 with the id numbers of the pages that you don't want to show in the menu. To add more just add another comma and then the number. If you create a lot of pages and don't want any of them added it might just be easier to get rid of the whole wp_list_pages line altogether and instead just create hardlinks to the pages that you do want in the menu. Let me know if you need any clarification on this...
Is the line that your talking about?: <?php wp_list_pages('title_li=&depth=-1'); ?> If so where exactly do I place the code you mentioned? Thanks,
Edit ur theme header.php or sidebar.php (depends where theme is pulling pages list) and find this line <?php wp_list_pages; ?> just remove also remove CSS of list pages but be carefull in removing list pages.
try opening your header.php and search for this function wp_list_pages there will be a code like this <?php wp_list_pages([COLOR="Red"]'sort_column=menu_order&title_li='[/COLOR]); ?> Code (markup): the text in red can be anything not necessary just add this &exclude=[COLOR="Red"]17,38[/COLOR] Code (markup): the nos. will be page no. which you want to exclude so your final code will be like this <?php wp_list_pages('sort_column=menu_order&title_li=&exclude=17,38' ); ?> Code (markup): where all the pages you want to exclude , page nos should be added if you still have problems please comment , hope i am helpful
Can you help me with the same issue? I don't want some wordpress pages in menu, because I created graphical buttons in header for them. Unfortunately, I am a better designer than the coder. I tried to use all above mentioned recommendations, but I failed. Here is the code of my home.php and index.php template files: <?php get_header(); ?> <?php query_posts('post_type=page&orderby=menu_order&order=asc&exclude=10'); ?> <div id="page"> <div id="slider"> <ul class="navigation"> <?php while (have_posts()) : the_post(); ?> <li><a href="#<?php echo $post->post_name ; ?>"><span><?php the_title(); ?></span></a></li> <?php endwhile;?> </ul> <div class="scrollButtons scrollMeLeft"><a><span>previous</span></a></div> <div class="scroll"> <div class="scrollContainer"> <?php while (have_posts()) : the_post(); ?> <div class="panel" id="<?php echo $post->post_name ; ?>"> <h3></h3> <?php the_content(); ?> </div> <?php endwhile;?> </div> </div> <div class="scrollButtons scrollMeRight"><a><span>next</span></a></div> </div> </div> <?php get_footer(); ?> PHP:
I has same problem For me help Exclude Pages plugin. It simple add "Include this page in lists of pages" check box.