![]() |
Hi there,
This is a great site by the way! Just what we've needed in the WP community.
I am stumped with this problem. I am trying to get sub-pages and then loop through them, listing all of the sub-pages and then outputting their individual thumbnail images, names and descriptions with custom fields.
Something is not working but I can't figure out what it is. I'm on a tight deadline so I'm a tad desperate. If anyone can figure this out I'd be grateful!
Thanks much.
Solution - 1Is the problem that the i+ in your for loop should be i++? Solution - 2Would this plug-in have your desired effect? [[LINK href="http://www.dagondesign.com/articles/list-subpages-plugin-for-wordpress/"]]http://www.dagondesign.com/articles/list-subpages-plugin-for-wordpress/[[/LINK]] Solution - 3This will list all subpages of a page ID of 218 with the required custom fields being shown. I also added in a few checks to make sure there's information before displaying anything.
Solution - 4Ahh! Where's the edit button? I posted the incorrect version. Please use this version instead:
Solution - 5Instead of using the page ID, I am using the function get_page_by_title() to retrieve the ID. It would allow you to use this code on multiple installations. Just change Your Page Name to the title of your parent page. Hope this helps.
Solution - 6Oops. I can't seem to edit my post. Change the following to
|
Wordpress |
Type: | Code Example |
Category: | Coding |
Sub Category: | Code Example |
Uploaded by: | Admin |
Views: | 71 |