# get_children Change Order in WordPress Theme



## sequoia13 (Aug 6, 2007)

I'm pretty sure this is a problem unique to the theme of the website so that's why I'm starting a new thread.

I need to change the order of the houses under "Premier Rentals" at this domain: http://www.joshuadesertretreats.com .

It's a Wordpress.org site and I'm not sure how to assign priority to each so that they display in a different order but I'm sure it's related to the red text below.

Here is the php code from the theme:


```
<?php block_start('scroller'); ?>
	<h2 class="title">Premiere Rentals</h2>
	<div class="container"><ul class="properties">
	<?php $properties = get_children([COLOR="Red"]'post_parent=6&post_type=page&post_status=publish&orderby=menu_order&order=ASC'[/COLOR]); foreach($properties as $property) { $id=$property->ID; $link=get_permalink($id); $title=$property->post_title; $content=$property->post_content; $image = get_the_image('thumbnail',1,$id); if($image) { ?>
		<li class="property">
			<h3 class="name"><a href="<?php echo $link; ?>"><?php echo $title; ?></a></h3>
			<a href="<?php echo $link; ?>"><img src="<?php echo $image; ?>" alt="" /></a>
			<?php if(get_post_meta($id,'max-guests',true)) echo '			<p class="max-guests">Sleeps up to '.get_post_meta($id,'max-guests',true).'</p>' . "\n"; ?>
			<p class="blurb"><?php if(get_post_meta($id,'blurb',true)) the_blurb(get_post_meta($id,'blurb',true)); else the_blurb($content); ?></p>
		</li>
	<?php } } ?>
	</ul></div>
	<a href="javascript:void(0);" class="next"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/next.png" alt="Next" /></a>
	<a href="javascript:void(0);" class="prev"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/prev.png" alt="Previous" /></a>
	<br class="clear" />
<?php block_end(); ?>
```
Does anyone see any thing that I'm missing? Thanks for your help.


----------



## tomdkat (May 6, 2006)

It appears the images are loaded in numerical order, from banner1 to banner6. If you can't find the parameter to pass to request a descending sort order of the images, maybe you could simply change the image names so the images are named in the order you want them displayed.

Peace...


----------



## sequoia13 (Aug 6, 2007)

Thanks for your reply tomdkat. The banner images are for the slideshow towards the top of the page. I need to rearrange the links/houses under "Premier Rentals" below the slideshow. Each one consists of the image, link, max guests, and blurb. Are there different values for "publish&orderby=" ?


----------



## tomdkat (May 6, 2006)

Try changing the order from "ASC" (ascending) to "DESC" (descending). That would reverse the order. If you wanted to mix them up and put them in a particular order, that would probably take some work OR you would have to order the posts, the "children" properly.

You can read about the parameters to get_children here.

Peace...


----------

