wordpress sub pages
- Started
- Last post
- 5 Responses
- 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?
- 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.