1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

get_children Change Order in WordPress Theme

Discussion in 'Web Design & Development' started by sequoia13, Aug 15, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. sequoia13

    sequoia13 Thread Starter

    Joined:
    Aug 6, 2007
    Messages:
    8
    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:

    Code:
    <?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.
     
  2. tomdkat

    tomdkat Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,141
    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...
     
  3. sequoia13

    sequoia13 Thread Starter

    Joined:
    Aug 6, 2007
    Messages:
    8
    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=" ?
     
  4. tomdkat

    tomdkat Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,141
    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...
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1012674