From c25a6fe381ee5bfed541ae652edfa5e3c2dd44a1 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 7 May 2008 19:57:15 +0000 Subject: [PATCH] Fix page 404 when page_for_posts is empty. see #6539 git-svn-id: http://svn.automattic.com/wordpress/trunk@7905 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index c0816bb3f7..21ac863473 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -923,7 +923,8 @@ class WP_Query { $reqpage = 0; } - if ( ('page' != get_option('show_on_front') ) || ( $reqpage != get_option('page_for_posts') ) ) { + $page_for_posts = get_option('page_for_posts'); + if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) { $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); $page_paths = '/' . trim($q['pagename'], '/'); $q['pagename'] = sanitize_title(basename($page_paths));