Fix post/page slug out. Props donncha. fixes #2472

git-svn-id: https://develop.svn.wordpress.org/trunk@3558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-02-20 17:13:06 +00:00
parent bcf84b6e6d
commit 5177b31702
2 changed files with 5 additions and 2 deletions

View File

@ -675,7 +675,7 @@ function get_page_by_path($page_path) {
foreach($page_paths as $pathdir)
$full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
$pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path'");
$pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'");
if ( empty($pages) )
return 0;
@ -684,7 +684,7 @@ function get_page_by_path($page_path) {
$path = '/' . $leaf_path;
$curpage = $page;
while ($curpage->post_parent != 0) {
$curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent'");
$curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent' and post_type='page'");
$path = '/' . $curpage->post_name . $path;
}

View File

@ -258,6 +258,9 @@ function the_meta() {
if ( $keys = get_post_custom_keys() ) {
echo "<ul class='post-meta'>\n";
foreach ( $keys as $key ) {
$keyt = trim($key);
if ( '_' == $keyt{0} )
continue;
$values = array_map('trim', get_post_custom_values($key));
$value = implode($values,', ');
echo "<li><span class='post-meta-key'>$key:</span> $value</li>\n";