All pastes #332430 Raw Edit

Anonymous

public php v1 · immutable
#332430 ·published 2007-01-29 23:51 UTC
rendered paste body
from header:<!-- Page Navigation --><ul id="nav"><li><a <?php if (is_home()) echo "id='current'"; ?> href="<?php bloginfo('url'); ?>">Home</a></li><?php$pages = liq_get_pages();if ($pages) {	foreach ($pages as $page) {		$page_id = $page->ID;		$page_title = $page->post_title;		$page_name = $page->post_name;		(is_page($page_id))?$selected = ' id="current"':$selected='';		echo "<li><a ".$selected." href=\"".get_page_link($page_id)."\">$page_title</a></li>\n";	}}?></ul>from functions.php:function liq_get_pages($with_content = ''){	global $wpdb;    $query = "SELECT ID, post_title, post_name FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";	if ($with_content == "with_content") {	   $query = "SELECT ID, post_title,post_name, post_content FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";	}	return $wpdb->get_results($query);}