List pages isn’t quite what I want
-
On my website
http://www.keziahhill.com
I have pages listed on the page sidebar and the blog sidebar and on the header. All fine, but I can’t work out how to get rid of the word “Page” from just above the list of pages. I use this code.- <?php wp_list_pages(‘exclude=169’); ?>
Is there something else I should do?
Thanks
Keziah
-
wp_list_pages isn’t putting “Page” on your site. Check your theme’s header and sidebar files and see if it isn’t hardcoded in there.
This is the whole code for my page sidebar. I can’t see anything in there that that I can change to get rid of. Any other suggestions?
Thanks
K<div id="sidebar"> <?php if (!is_home()) {?> <ul><?php wp_list_pages('exclude=169'); ?></ul>
[moderated, snipped the rest that was of no value to the discussion]
Since I know nothing about coding, it took me a while to figure out how to edit the “exclude” argument in wp_list_pages so that it wouldn’t screw up the rest of the page. For the benefit of other nubs like me, I thought it might be worth while to detail it here:
NOTE: All of this is mentioned in http://codex.wordpress.org/Template_Tags/wp_list_pages#Exclude_Pages_from_List, but it’s not really spelled out for code-illiterate people like myself.
The wp_list_pages you want to edit is in the “header” php file in your theme editor. It might look something like this:
<ul> <li><a href="<?php bloginfo('url'); ?>">Home</a></li> <?php wp_list_pages('depth=-1&title_li=');?> </ul>
The arguments you’ll be using are:
‘exclude=12’ – where 12 represents the ID# of whatever page you want to exclude, and
‘title_li=’ – which removes the heading text above your page links (commonly and infamously seen as “Pages”)
Putting them both together in the wp_list_pages tag will look like this:
<?php wp_list_pages('exclude=12&title_li=');?>
The two arguments are separated by an inclusive “&”.
This worked for me, and erasing the ‘depth=-1&title_li=’ thing that was originally included in wp_list_pages didn’t seem to affect anything. I hope this helps, and I hope I didn’t make some lame mistake. lol.
- The topic ‘List pages isn’t quite what I want’ is closed to new replies.