<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Maverick Web Creations &#187; bug</title>
	<atom:link href="http://www.maverickwebcreations.com/tag/bug/feed" rel="self" type="application/rss+xml" />
	<link>http://www.maverickwebcreations.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 05:37:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Fix the &#8220;Exclude Pages from List&#8221; WordPress Bug</title>
		<link>http://www.maverickwebcreations.com/2008/08/19/how-to-fix-the-exclude-pages-from-list-wordpress-bug.html</link>
		<comments>http://www.maverickwebcreations.com/2008/08/19/how-to-fix-the-exclude-pages-from-list-wordpress-bug.html#comments</comments>
		<pubDate>Tue, 19 Aug 2008 04:12:01 +0000</pubDate>
		<dc:creator>admin_mwc</dc:creator>
				<category><![CDATA[Wordpress Help]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_pages]]></category>
		<guid isPermaLink="false">http://www.maverickwebcreations.com/?p=110</guid>
		<description><![CDATA[<p>This is another annoying WordPress bug I discovered about 4 months ago. I <a rel="nofollow" href="http://wordpress.org/support/topic/164745?replies=5">posted this bug on the WordPress support forum</a> but the WordPress team have not fixed it yet. This &#8220;exclude pages from list&#8221; bug only affects you if you use WordPress pages with sub pages. WordPress 2.5 and &#8230; <a href="http://www.maverickwebcreations.com/2008/08/19/how-to-fix-the-exclude-pages-from-list-wordpress-bug.html" class="read_more">Read more...</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is another annoying WordPress bug I discovered about 4 months ago. I <a rel="nofollow" href="http://wordpress.org/support/topic/164745?replies=5">posted this bug on the WordPress support forum</a> but the WordPress team have not fixed it yet. This &#8220;exclude pages from list&#8221; bug only affects you if you use WordPress pages with sub pages. WordPress 2.5 and up do not seem to allow the hiding of certain sub pages with the &#8220;exclude&#8221; parameter. The exclude parameter is supposed to do the following as documented by WordPress:</p>
<blockquote><p><strong>Exclude Pages from List</strong></p>
<p>Use the exclude parameter hide certain Pages from the list to be generated by wp_list_pages. Excluding a Page will also exclude all of its sub-pages from the list to be generated.</p></blockquote>
<p>The last time this worked was in WordPress 2.3.3. Sadly, it is still not working in WordPress 2.6.1.</p>
<p>To fix this bug, you will need to replace the <a rel="nofollow" href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages</a> function with the one in WordPress 2.3.3. Open the file &#8220;<strong>post-template.php</strong>&#8221; in the &#8220;<strong>wp-includes</strong>&#8221; folder with your favourite text/html editor.</p>
<p>Copy the following code:</p>
<pre class="brush: php; title: ; notranslate">
function wp_list_pages($args = '') {
$defaults = array(
'depth' =&amp;gt; 0, 'show_date' =&amp;gt; '',
'date_format' =&amp;gt; get_option('date_format'),
'child_of' =&amp;gt; 0, 'exclude' =&amp;gt; '',
'title_li' =&amp;gt; __('Pages'), 'echo' =&amp;gt; 1,
'authors' =&amp;gt; '', 'sort_column' =&amp;gt; 'menu_order, post_title'
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = '';
$current_page = 0;
// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
// Allow plugins to filter an array of excluded pages
$r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
// Query pages.
$pages = get_pages($r);
if ( !empty($pages) ) {
if ( $r['title_li'] )
$output .= '&amp;lt;li class=&quot;pagenav&quot;&amp;gt;' . $r['title_li'] . '&amp;lt;ul&amp;gt;';
global $wp_query;
if ( is_page() )
$current_page = $wp_query-&amp;gt;get_queried_object_id();
$output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
if ( $r['title_li'] )
$output .= '&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;';
}
$output = apply_filters('wp_list_pages', $output);
if ( $r['echo'] )
echo $output;
else
return $output;
}
</pre>
<p>Replace the entire area of the code of the existing wp_list_pages function, which looks something like &#8220;<strong>wp_list_pages($args = &#8221;) { blah blah blah }</strong>&#8220;. Once you have done this, your WordPress pages will display sub pages and exclude certain pages correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maverickwebcreations.com/2008/08/19/how-to-fix-the-exclude-pages-from-list-wordpress-bug.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

