View Full Version : Add Page that's NOT on the navigation buttons?
wahmsuzanne
11-01-2008, 08:24 PM
On Wordpress ... is there a way to add a page on my blog that will not show up as a navigation button but will still have all of the template componets ... header/sidebars, etc.? Thanks! *SmiLes* Suzanne
On Wordpress ... is there a way to add a page on my blog that will not show up as a navigation button but will still have all of the template componets ... header/sidebars, etc.? Thanks! *SmiLes* Suzanne
Open up the relevant template and find where you've included the wp_list_pages code and add the argument 'exclude=12' where 12 is the ID of the page you want to remove. Eg:
<ul>
<?php wp_list_pages('exclude=12,17,21' ); ?>
</ul>
If you're not sure about doing that yourself manually there are, I believe, a couple of plugins that will let you do it.
wahmsuzanne
11-01-2008, 08:49 PM
thanks Hurricane~ so how do I know the page number? I have to create it ... let it show up there first ... then go in and add this to the code? Thanks! I'll keep a backup so I won't be afraid to try this. *SmiLes* Suzanne
P.S. Any idea what page/file this MIGHT be on?
thanks Hurricane~ so how do I know the page number? I have to create it ... let it show up there first ... then go in and add this to the code? Thanks! I'll keep a backup so I won't be afraid to try this. *SmiLes* Suzanne
P.S. Any idea what page/file this MIGHT be on?
You can save a draft or private page if you don't want it published before you've excluded the page. You can get the ID by opening that page up in the page manager. Or you can install the reveal page IDs plugin.
Which template file it's in will depend on where the menu appears - look in header.php and sidebar.php, which are common places for a menu. Or install this plugin which will let you control it from your admin area: http://wordpress.org/extend/plugins/page-link-manager/
sarahG
11-01-2008, 09:06 PM
Highly recommend the Reveal IDs (http://www.schloebe.de/wordpress/reveal-ids-for-wp-admin-25-plugin/) plugin for anyone who wants to see the IDs for posts, pages, categories and/or links. WP 2.5 made a daft move hiding these, let's hope 2.7 brings them back.
wahmsuzanne
11-01-2008, 09:11 PM
Thank you again for all of your help! I hope I'm doing this right! LOL
I did a test page and saved as draft, the end of the url:
page.php?action=edit&post=543
So in your example would it be
<ul>
<?php wp_list_pages('exclude=543' ); ?>
</ul>
Is that right? Thanks! Suzanne
Is that right? Thanks! Suzanne
Yep, that's fine. You might find it easier to exclude with the plugin I linked to above. And Sarah has linked the reveal page IDs plugin I mentioned too. Both very useful, as is the my page order (http://www.geekyweekly.com/mypageorder) plugin.
Sarah also has a good pages tutorial on Blogging Tips (http://www.bloggingtips.com/2008/04/27/static-pages-in-wordpress/) which covers this topic.
wahmsuzanne
11-01-2008, 09:28 PM
You two are both so AWESOME! I really do appreciate the help. I'm a total technophobe. LOL
I'm going to back up here for a second and tell you what I'm doing and maybe there's a better solution ...
I am adding some videos to YouTube that are each slightly different i.e. to different organizations and instead of pointing them to a YouTube url and then hoping they find their way back to my blog ... I wanted to create individual pages for each on my blog so once there they watch the video and hopefully view the rest of my site. I don't want a blog post for each as that would be lame for the rest of my readers ... and I don't want them on the navigation ... I THINK my options are to either add them as a post and "back date" them ... or this page idea.
Any thoughts are appreciated ... thanks again! Suzanne
P.S. If I go ahead and try one without these plugins ... will everything still work the same if I do add the plugins? *sigh* Suzanne
sarahG
11-01-2008, 09:35 PM
The pages option is the easiest so I'd stick with that, and no you don't need to add the plugins. Follow hurricane's instructions above and you should be fine.
If you aren't, just post your code up here and we can help you out :)
Donace
11-01-2008, 10:40 PM
dammit i should have visited here earlier! i actually spent a good part of an hour doing this hack manually on my theme to fix a few issues I was having with IE and to display only only certain pages.
I found the page ids by going to the 'manage' function in WP and checking the links
wahmsuzanne
11-02-2008, 12:10 AM
I'm so grateful for all of your help!!!!!!!!!!! I just tried the Page Link Manager Plugin and it works great! I will look at the other two as well ... I really appreciate the help ... *huGs* Suzanne
sarahG
11-02-2008, 09:06 AM
Just to add to this thread, if you want to exclude pages (without the plugin), then you need to take the parameter exclude (which hurricane posted up) and add it to the existing parameters of your wp_list_pages() tag. ie. you could have
wp_list_pages();
or
wp_list_pages('title_li=');
so you insert 'exclude=1,2,3' in with that, if there's an existing parameter, put an ampisand (&) sign between parameters eg.
wp_list_pages('title_li=&exclude=1,2,3');
This is pretty much the same for most of the template tags.
However, if you're not keen on messing with the code or constantly having to update the exclude list then go for the plugin... OR (there's always and or!)
If you only have say a handful of pages that you'll want displayed then there is the 'include' parameter. This way you can specify your include list and add any number of additional pages without having to add the ID to the exclude list eg
wp_list_pages('title_li=&include=1,4,5,7,9');
Then only pages with the IDs of 1, 4, 5, 7 and 9 will be displayed in the list and nothing else until you add it.
Oh and just to explain, title_li= sets the top title of the pages list and also puts that in a list item and outputs a second unordered list.
Jeffro
11-03-2008, 01:04 PM
I'm surprised no one mentioned the plugin Exclude Pages - http://wordpress.org/extend/plugins/exclude-pages/ which does exactly what you wanted.
athlon24
11-03-2008, 03:01 PM
that makes it even more convenient. I was thinking about that yesterday when I read this thread. I just forgot to google it. By the way, that's a plugin that every serious blogger must have.
navjotjsingh
11-03-2008, 05:37 PM
I am surprised...for even simple tasks such as excluding pages...you need a plugin? If for every single task...we start using the plugin....imagine the number of plugins required on a blog run by a newbie...One should try to learn the tricks behing smallest of plugins and try to integrate atleast those features which are theme specific...Lessen the load on your servers and optimise the blog by making several small features inbuilt into your themes.
I am not saying...its easier to do it...but newbies should try and minimise the use of small plugins....this will make it easier to troubleshoot any small problem in your blog arising at any future time.
Now since method to exclude pages is already listed in this thread..I don't see the reason you should need that Exclude pages plugin.
sarahG
11-03-2008, 05:59 PM
I'm surprised no one mentioned the plugin Exclude Pages - http://wordpress.org/extend/plugins/exclude-pages/ which does exactly what you wanted.
Page Link Manager does exactly the same job which was linked to by hurricane :)
I am surprised...for even simple tasks such as excluding pages...you need a plugin?
For any seasoned or even newbie developer, no you don't really. But there are plenty of people out there who don't even understand the basics of HTML. These are pretty basic plugins and won't cause much of a load on the server. The plugin files are small, they just add an action to a particular function and that's it.
Now since method to exclude pages is already listed in this thread..I don't see the reason you should need that Exclude pages plugin.
Do you ever use the All in One SEO pack plugin? One of the most popular plugins out there? Do you realise that you don't need to?! Just use custom fields for your page title, description and keywords.
But, because it makes lives easier and doesn't require any code changes, people continue to use it, however there's nothing in there that couldn't be done by hand. But then again, most plugins could be dropped if you knew how to do what they do by hand, but why bother? You either bloat your code or you add a plugin that'll continue to work as it should even when you change your theme.
vBulletin® v3.8.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.