WordPress.org

Support

Support » Themes and Templates » [Resolved] get_children => sort_order not working

[Resolved] get_children => sort_order not working

  • I’m having trouble convincing a get_children query to order.

    I’m using the code below to pull children of the current page two at a time.

    for ($i = 0; $i < 10; $i++,$i++) { // iterate through by two
    		$args = array ('post_parent'=>get_the_ID(),'post_status'=>'publish','numberposts'=>2,'offset'=>$i,'sort_order'=>'ASC'); // Build the query
    		$prods = get_children($args);
    		if(empty($prods)) continue; // Exit loop

    Everything is working perfectly with the one exception of sort_order. I’ve tried putting it in every position in the array and still nothing changes when I do ASC or DESC as the value.

    Any ideas? I feel like I’m just missing something obvious and need an extra set of eyes.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] get_children => sort_order not working’ is closed to new replies.
Skip to toolbar