' . $r['title_li'] . '
';
$pg_sty='';
$pg_sty_close='';
if ( (is_home()) && (!is_paged()) ) {
$pg_sty ='';
$pg_sty_close='';
}
//}
$output .='| '.$pg_sty.'Home'.$pg_sty_close.' ';
// Now loop over all pages that were selected
$page_tree = Array();
foreach ( $pages as $page ) {
// set the title for the current page
$page_tree[$page->ID]['title'] = $page->post_title;
$page_tree[$page->ID]['name'] = $page->post_name;
// set the selected date for the current page
// depending on the query arguments this is either
// the createtion date or the modification date
// as a unix timestamp. It will also always be in the
// ts field.
//if ( !empty($r['show_date']) ) {
// if ( 'modified' == $r['show_date'] )
// $page_tree[$page->ID]['ts'] = $page->post_modified;
// else
// $page_tree[$page->ID]['ts'] = $page->post_date;
//}
// The tricky bit!!
// Using the parent ID of the current page as the
// array index we set the curent page as a child of that page.
// We can now start looping over the $page_tree array
// with any ID which will output the page links from that ID downwards.
if ( $page->post_parent != $page->ID)
$page_tree[$page->post_parent]['children'][] = $page->ID;
}
// Output of the pages starting with child_of as the root ID.
// child_of defaults to 0 if not supplied in the query.
$output .= _mjn_page_level_out($r['child_of'],$page_tree, $r, 0, false);
//if ( $r['title_li'] )
// $output .= '
';
}
$output .='|';
//$output = apply_filters('mjn_list_pages', $output);
if ( $r['echo'] )
echo $output;
else
return $output;
}
function _mjn_page_level_out($parent, $page_tree, $args, $depth = 0, $echo = true) {
global $wp_query;
$queried_obj = $wp_query->get_queried_object();
$output = '';
if ( $depth )
$indent = str_repeat("\t", $depth);
//$indent = join('', array_fill(0,$depth,"\t"));
if ( !is_array($page_tree[$parent]['children']) )
return false;
foreach ( $page_tree[$parent]['children'] as $page_id ) {
$cur_page = $page_tree[$page_id];
$title = $cur_page['title'];
$linkstyle='';
$closestyle='';
$css_class = 'page_item';
if ( $page_id == $queried_obj->ID ) {
$linkstyle='';
$closestyle='';
}
//This line below is the one you modify to get the output you'd like!
$output .= '| '.$linkstyle . $title . $closestyle.' ';
/*if ( isset($cur_page['ts']) ) {
$format = get_settings('date_format');
if ( isset($args['date_format']) )
$format = $args['date_format'];
$output .= " " . mysql2date($format, $cur_page['ts']);
}*/
/*if ( isset($cur_page['children']) && is_array($cur_page['children']) ) {
$new_depth = $depth + 1;
if ( !$args['depth'] || $depth < ($args['depth']-1) ) {
$output .= "$indent\n";
$output .= _mjn_page_level_out($page_id, $page_tree, $args, $new_depth, false);
$output .= "$indent
\n";
}
}*/
//$output .= "$indent\n";
}
if ( $echo )
echo $output;
else
return $output;
}
?>