"If you can get along with everyone and everyone loves you, then you don't stand for much. A person who stands his ground for his principles and won't compromise his integrity is not loved by everyone."
- Larry Winget

How to Fix the Exclude Tree Pages Bug in WordPress 2.7

Sometimes a new WordPress release messes up things that they fixed in a previous version. Here we go again with the irritating exclude pages bug in WordPress! The fix is something similar to post I blogged about in August

My fix was inspired by this post from Texto.de. I also posted my exclude_tree fix on the WordPress forum.

Open up wp-includes/post-template.php in your favourite editor. Look for the line 616:

616
$r['hierarchical'] = 0;

Add 2 back slashes to the code to “comment hide” it.

616
//$r['hierarchical'] = 0;

That’s all there is to it! Stop using the exclude_tree parameter for the wp_list_pages function until a fix has been announced.

Tagged As: , , ,

Posted by Vincent on 16 January 2009 12:51 PM in Wordpress Help You can leave a comment, or trackback from your own site. |

Similar Posts

Did You Enjoy This Post?

Subscribe to our blog through our RSS feed or email to receive updates on more posts like this. post on your favourite social networking or media site to let others know about this post. Help us generate more buzz by submitting/voting for this post with the following buttons.

6 Comments On “How to Fix the Exclude Tree Pages Bug in WordPress 2.7”

On 9th March 2009 3:19 PM, jNo Gravatar said:

This is a disable more than a fix, correct?

On 9th March 2009 3:34 PM, VincentNo Gravatar said:

It is a fix. The default 2.7 code does not allow exclude pages.

On 28th April 2009 1:28 PM, WillansNo Gravatar said:

Must agree with J. If it was a fix, it would make it work. All you’ve done is disable something.

On 28th April 2009 2:10 PM, VincentNo Gravatar said:

Do you have a better solution? I have no idea why WordPress messes up this exclude page feature.

On 28th April 2009 3:28 PM, jNo Gravatar said:

I went a different route with this and used a plugin called BigBigMenu (http://www.bigbigtech.com/wordpress-plugins/big-big-menu/) that a friend of mine wrote. It did the trick with only a small adjustment to include children categories + pages.

On 1st June 2009 5:10 AM, GeejayNo Gravatar said:

Why doesn’t it work with mine? It excludes only up to 3 pages. I need to exclude up to 8 pages.

1 Trackback On “How to Fix the Exclude Tree Pages Bug in WordPress 2.7”

Post a Comment


(Required)


(Required)