Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

mathieus on "Listing pages in a loop: styling childs and child-of-childs"

$
0
0

Hi,

I'm working on a website with 1 page, but, as a matter of making the admin clear, the different topics should be divided into different pages.
I have this code for that:

<?php get_header() ?>
<?php query_posts(array('showposts' => 20, 'post_type' => 'page', 'order' => 'ASC')); while (have_posts()) { the_post(); ?>
<div><?php the_title(); ?></div>
<div><?php the_content(); ?></div>
<?php } ?>
<?php get_footer() ?>

this does as I please: showing a title and the content (which i will later make toggable).
What i would like to do is: the parent page should have a class, the childs should have a second class, child-of-childs should have a third class, so i can style all 3 depth's separately. Would this be possible with this code? I'd like to give it a list styling actually, just as the wp_list_pages does.

thanks!
Mathieu


Viewing all articles
Browse latest Browse all 8245

Trending Articles