yes, you dont put template tags inside pages like that. template tags go inside template files. wp_list_pages is a template tag.
ah, hehe, hence the name “template tag”
so how might I accomplish this? If I create a bunch of pages that are sub pages of another page. is there an easy way to automatically create a list of these sub-pages within the parent page?
so how might I accomplish this?
youre on the right track with using that bit of code.. you just need to put it in the right place
why dont you just use a widget to list your pages?
http://www.arnoldbreukhoven.nl/2007/03/breukies-pages-widget-for-wordpress/
or maybe this one?..
http://wordpress.org/extend/plugins/flexi-pages-widget/
unfortunately, I don’t want these sub-pages listed globally in a widget… (from my understanding, widgets get put in the sidebar, which is loaded on every page).
I would like the list of sub-pages to appear in-line on their parent page.
For example, imagine that I have a page called “Camping” that will be the parent page, and many subpages about specific camping trips that I have gone on.
I put a brief paragraph on the parent page that I love camping and will list each of my camping trips below. And then I want to use the functionality of wp_list_pages to list all of the subpages so that people can reference this as a running list of all my camping trips, and they should be able to click the title of each listed page to be directed to a subpage with details about that particular trip.
I understand that this is apparently a complicated thing that wordpress isn’t designed to do… at least not out of the box. I am reading about page templates and hope to be able to create a custom template that will do this…
Okay, problem solved… to anyone else that wants to do this… you can’t quite do what I wanted because the list of subpages must be at the end of the parent page’s normal content.
Basically, I found the page.php template file, copied it as page_with_subpages.php and put this at the top of the file:
<?php
/*
Template Name: Page_With_Sub_Pages
*/
?>
Then I put this code immediately following the line with “the_content();”
<ul>
<?php
wp_list_pages('title_li=&child_of='.$post->ID); ?>
</ul>
When you next edit a parent page that you want to list sub-pages of this parent, you can select this custom template as that page’s default template.
MAN I love YOU.
Seriously.
I tried to figure out why wp_list_pages() didnt work for MONTHS and now IT WORKS!
thanks a lot and excuse me for the excitement, but you solved me a GREAT problem.
thank you again.