Sub-page hierarchy, show pages on default menu. TODO: Ping Michael about top-level pages in kubrick menu.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt
2005-01-01 23:05:07 +00:00
parent 21f5e3f715
commit 373276ee25
5 changed files with 47 additions and 19 deletions

View File

@@ -49,6 +49,7 @@ function the_title_rss() {
function get_the_title($id = 0) {
global $post, $wpdb;
$title = $post->post_title;
if ( 0 != $id )
$title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $id");
@@ -365,10 +366,15 @@ function wp_list_pages($args = '') {
if (!isset($r['depth'])) $r['depth'] = 0;
if (!isset($r['show_date'])) $r['show_date'] = '';
if (!isset($r['child_of'])) $r['child_of'] = 0;
if ( !isset($r['title_li']) ) $r['title_li'] = __('Pages');
// Query pages.
$pages = get_pages($args);
if ( $pages ) :
if ( $r['title_li'] )
echo '<li>' . $r['title_li'] . '<ul>';
// Now loop over all pages that were selected
$page_tree = Array();
foreach($pages as $page) {
@@ -397,6 +403,9 @@ function wp_list_pages($args = '') {
// Output of the pages starting with child_of as the root ID.
// child_of defaults to 0 if not supplied in the query.
_page_level_out($r['child_of'],$page_tree, $r);
if ( $r['title_li'] )
echo '</ul></li>';
endif;
}
function _page_level_out($parent, $page_tree, $args, $depth = 0) {

View File

@@ -228,7 +228,7 @@ ul.post-meta span.post-meta-key {
#menu ul ul li {
border: 0;
font: normal normal 70%/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
letter-spacing: 0;
margin-top: 0;
padding: 0;

View File

@@ -3,6 +3,7 @@
<div id="menu">
<ul>
<?php wp_list_pages(); ?>
<?php get_links_list(); ?>
<li id="categories"><?php _e('Categories:'); ?>
<ul>