"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
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: 2.7, exclude page, exclude_tree, WordPress
6 Comments On “How to Fix the Exclude Tree Pages Bug in WordPress 2.7”
On 9th March 2009 3:19 PM, j
said:
This is a disable more than a fix, correct?
On 9th March 2009 3:34 PM, Vincent
said:
It is a fix. The default 2.7 code does not allow exclude pages.
On 28th April 2009 1:28 PM, Willans
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, Vincent
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, j
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, Geejay
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