Exclude pages from wordpress Menu / Navigation

Submitted on: 07 Feb 09

Website Address:

Category: Resources, Tutorials, Wordpress

Website Rating:

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Resource Description:

Exclude pages from wordpress Menu / Navigation

As a beginner you might or might  not know what wp_list_pages is, but i m not going to waste much time and explain you in detail, here is quick one line explanation

wp_list_pages in WordPress is a method to the list of pages that are available in your blog, you can add this code in the theme whereever you want a list of pages to appear.  Normally its found in header like this

<?php wp_list_pages('title_li='); ?>

How to exclude pages from main navigation? The answer is simple, here it goes

Replace in (header.php)

<?php wp_list_pages('title_li='); ?>

with

<?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&exclude=94'); ?>

94 is the id of the page you have created. To find an id for the page go to Pages in the left menu of your Wordpress Admin  and hover over the page on the right to find out the id of that page.

If you want to hide multiple pages, use the code below. In this case you will be able to hide 2 pages which has id 94 & 6.

<?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&exclude=94,6'); ?>

If you liked this simple tutorial, do comment.

50 Total TweetBacks: (Tweet this post)
  • en: '..Every adversity has within it..the seeds of an equivalent or a greater benefit....-Napoleon Hill 07/14/09 11:06am
  • en: @318i are you sure you love it or are you just saying that? 07/14/09 11:06am
  • en: Ok. I either: a) need to get some sleep or b) need to brew up some java and forget this whole "sleep" thing all together. 07/14/09 11:06am
  • en: @officialtila you're body can go into sleep deprivation, can cause hallucinations or psycosis, not that you need to get any crazier <3 07/14/09 11:06am
  • en: Money Can’t Buy You Love or Good Broadband: 14 July 2009 – London, UK: Some of the UK’s wealthiest and high-prof.. http://tinyurl.co 07/14/09 11:06am
  • en: Here comes the sun! Gettin' my vitamine D shot now :) (you like it black or white?) :D 07/14/09 11:06am
  • en: Money Can’t Buy You Love or Good Broadband: 14 July 2009 – London, UK: Some of the UK’s wealthiest and high-prof.. http://tinyurl.co 07/14/09 11:06am
  • en: @majeedb this show how you are facist iam afriad i mean to embrace your point of view or i'll be an open hearted person 07/14/09 11:06am
  • en: Are you making a living or earning a fortune? Which would you prefer? Check it out, 0 start up costs & xtra low maint http://powerful5.com/ 07/14/09 11:06am
  • en: drinking at 5 am. good or bad. i'll let progress decide. 07/14/09 11:06am
  • en: Umbrellas in food or drink makes me happy /Cupcakes Take The Cake/ - How summery, right? Festive cupcakes ... http://tinyurl.com/nkrr35 07/14/09 11:06am
  • en: @voguist Will be enlisting your assistance in a week or so when all the show stuff dies down and I'm bored again! 07/14/09 11:06am
  • en: http://img.ly/1Ga Starting to get busy at the Town Hall! Just heard the or ganist practising! 07/14/09 11:06am
  • en: A number of Eircom customers had no internet access or experienced delays in browsing due to a suspected attack .. http://short.ie/dj08ha 07/14/09 11:06am
  • en: pain won't go away, i've tried everything.. Some one help me... cut my head off or something..LOL Why?why?why?why?? 07/14/09 11:06am
  • en: Not sure which I prefer - twirls or flakes.... 07/14/09 11:06am
  • en: @jshe you're still 500 or so ahead 07/14/09 11:06am
  • en: RT @akinasuna: Is there any cheap flight ticket company except Kayak or skyscanner? 07/14/09 11:06am
  • en: @mrpeterandre Hello peter, How much is your booking fee for a P/A ? who's your agent or manager? Thanks, Adam 07/14/09 11:06am
  • en: @manishajoshi LOL. Nevermind about the followers, you're lucky I'm on Twitter with you... Or you'll be asking around in class to sign up! (: 07/14/09 11:06am
  • en: @R_City did ray hit Dru or khaled to check schedaule?? Lemme know 07/14/09 11:06am
  • en: @RicBucher jarrett jack a positive or negetive addition? for toronto. 07/14/09 11:06am
  • en: mmmm qoinq too Bedddd (: Gooodnightt or shudd i say Good Morning twitter . Birthdays on Friday !!!! Wooo <$ 07/14/09 11:06am
  • en: @yungseng either you're a jinx or i'm a jinx! heh. 07/14/09 11:06am
  • en: @CarolineLost Er.....Rio? Hello? Quality tune. Florence is there too! Boooo! Nun outfit or Florence.....? x 07/14/09 11:05am
  • en: @cameronreilly well now u said @fddlgrl will be on the show ill une in, was tossing up tween #masterchef or 3trueblood 07/14/09 11:05am
  • en: @Trinikki awwww or real lil shawty 07/14/09 11:05am
  • en: I have not eat lunch, and I think burgers are in my mind now. Or am I hallucinating? 07/14/09 11:05am
  • en: @Janaaahaa When you read this: please come online or call me! ;) 07/14/09 11:05am
  • en: Hmmm, to sleep or not to sleep. That is the ? 07/14/09 11:05am
  • en: Still no news regarding the baby. There is absolutely 0 control or influence in this matter..... come on - we want to meet you now!!!!! 07/14/09 11:05am
  • en: should I get an MFA in Film Production or a PhD in Media Studies??? 07/14/09 11:05am
  • en: @TheCaptainRex pizza doesn't get delivered by girls anymore or i would. its rodians or bust 07/14/09 11:05am
  • en: same here! :PRT @RockBouvier: Morning ppl:D Today my fam is coming home late! So I don't have to have dinner with them or talk to themXD 07/14/09 11:05am
  • en: Hey txt @marcosg to 729669 or call me 1 (720) 259-9250 07/14/09 11:05am
  • en: @fruitdance Thats true but we can talk about anything or just talk about nothing! 07/14/09 11:05am
  • en: @startupsg 5. Strategy to use Android OS or Chrome OS in Embeddable devices and further plans (if any) to produce your own hardware? 07/14/09 11:05am
  • en: @Collect_able She used to do Tours where you are at or London or gees somewhere, lol 07/14/09 11:05am
  • en: Slepp or watch an epic duel between two grandmas wielding "lightsaber" canes? 07/14/09 11:05am
  • en: @JamesM_39 Cash or tourneys? 07/14/09 11:05am
  • en: @BrianNippon so do you guys really have 30 days of night OR WHAT? 07/14/09 11:05am
  • en: @fartingpen Which one havent u heard by personal exp.? Pigs copulating or APJ in Apollo Hospital? 07/14/09 11:05am
  • en: RT @jimmyfallon #fallonmonologue Tomorrow is the Major League Baseball All-Star Game. Or as the Mets like to call it, "vacation." 07/14/09 11:05am
  • en: @EllenIsGod i see what you mean by the size of Texas or wherever it was 07/14/09 11:05am
  • en: I'm now so old that I usually have no idea if @alyankovic 's new songs are full parodies or "style parodies" till I research them a bit. 07/14/09 11:05am
  • en: @aligno Ask him if he prefers to wield a monkey-wrench or an adjustable spanner. 07/14/09 11:05am
  • en: I need to start running or something. Im getting chubby x( I guess Ill trying to do that after biology 07/14/09 11:05am
  • en: @MsNabilalah my friend recommend to go http:\www.ite.edu.sg which i think u went to see or given a booklet for it... 07/14/09 11:05am
  • en: To make it in this life, I love the advice from Andy Andrews to "persist without exception". Don't let anyone or anything stand in your way. 07/14/09 11:05am
  • nl: @star_girlsophie cinema or brewery? 07/14/09 11:05am

[Post to Twitter] Tweet This Post 

Support CSSkid.com

If you are the owner of the above website, Support us by using the featured on icon. This is our only source of promotion.

Got something constructive to say?