wordpress sub pages
- Started
- Last post
- 5 Responses
- jimzy
This seems so basic, I'm sure someone has tackled this issue before. I'm working on a Wordpress site, lets say the site is built like this:
home
about
projects
- project 1
- project 2
- project 3
contentIs there an easy way, within wordpress to automatically feed content and imagery from the sub project pages into the main project page, so that as the client ads new projects they will feed to the main projects page?
thanks in advance.
- EdTheDuck1010
This will get you a list of children, but you can re-use it to pull what you want through I would think.
<?php
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ($children) { ?><ul>
<?php echo $children; ?>
</ul>
<?php } ?>
- Nathan_Adams0
You're better off doing projects as it's own custom post-type. Then set up the Projects parent page like you would a blog page, except use <?php query_posts('post_type=projects'); ?> just before the loop.
- raf0
Most portfolio-type templates use posts rather than pages for content, I don't like it. Why not keep them tight in pages? Posts are for blog/news.
query_posts is good...
http://stackoverflow.com/questio…but there is a better way to do queries outside the main loop, with WP_Query objects:
http://www.binarymoon.co.uk/2010…- Hence custom post types. Keep folio separate from blog/news. To me, folio is non-heirachal.Nathan_Adams
- jimzy0
Hey great thanks for that raf,
That query_posts seems perfect, have you used it before?
Do you know if it is relativly simple to set up... I know a very basic amount of php. Trying to get it working here but not much joy, would you have any links/info on how to get this working?