Page 1 of 1

need help quickly understand this line of code!

Posted: Tue Dec 08, 2009 2:00 pm
by clarkluke
I am supposing this is the line of code that affects what I need to change.

$files =& get_children('post_parent='.$post->ID.'&post_type=attachment&post_mime_type=application/pdf&order=ASC');

I need to change that line of code to tell the script to order it by the title of the attachment when they view the files from a drop down. Right now it is doing it by date with the oldest at the bottom. Thanks in advance!

Re: need help quickly understand this line of code!

Posted: Tue Dec 08, 2009 2:45 pm
by incubi
Hi,

I'm not a pro by any means but I would need to see the routine that handles
order=ASC

If its simply formatting for an SQL query then ORDER BY attachment ASC
would be the change needed.

incubi

Re: need help quickly understand this line of code!

Posted: Fri Dec 11, 2009 1:31 pm
by clarkluke
I figured it out. after order I just had to put "orderby=title&order=ASC"


Thanks for the help!