Skip to content

Instantly share code, notes, and snippets.

@jarednova
Last active March 31, 2016 00:41
Show Gist options
  • Save jarednova/b8cd20bbd534483a9a0dff6e39eee237 to your computer and use it in GitHub Desktop.
Save jarednova/b8cd20bbd534483a9a0dff6e39eee237 to your computer and use it in GitHub Desktop.
<?php
function MyChildPostClass extends TimberPost {
function special_children() {
/* modify the query on line 7 as you need */
$children = get_children('post_parent=' . $this->ID . '&post_type=post&numberposts=-1&orderby=menu_order title&order=ASC&post_status=publish');
foreach ( $children as &$child ) {
$child = new $childPostClass($child->ID);
}
$children = array_values($children);
return $children;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment