wp_list_pages doesn't render link_before or link_after now that I've upgraded to 2.9.2!
wp_list_pages doesn't render link_before or link_after now that I've upgraded to 2.9.2!
I just found the same problem. At first I thougth it was my css code bug
I've got a jQuery work around setup for now but this is really unfortunate. Here's the code I'm using in my theme's header.php in case it might help you:
<script type="text/javascript">
jQuery(document).ready(function() {
// bug fix : http://wordpress.org/support/topic/365260
// inserts span tag around the links in wp_list_pages
jQuery('div.inbar ul li a').contents().wrap('<span />');
});
</script>I thought I'd follow up here in case anyone else is having this issue... I narrowed the problem down to the Page Menu Editor plugin - disabling that fixes the issue.
Commenting the line 770 of wp-includes/post-template.php:
767 $output .= '</ul></li>';
768 }
769
770 //$output = apply_filters('wp_list_pages', $output, $r);
771
772 if ( $r['echo'] )
773 echo $output;
774 else
will make it work.
thanks mindshare.
the All In One SEO pack uses the same code as the Page Menu Editor so your jQuery was needed in my case (only slightly edited for my situation).
I needed to add different elements before and after the link text:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('div#nav ul li a').prepend('<span class="left"></span>');
jQuery('div#nav ul li a').append('<span class="right"></span>');
});
</script>
I also made a post on the developers forum:
http://semperfiwebdesign.com/forum/all-in-one-seo-pack-troubleshooting/wp_list_pages-link_before-and-link_after-conflict-with-menu-label/#p1912
Unfortunately I've never managed to get the pattern match needed to allow a before/after link option. If anyone has any suggestions I'm happy to add them as a collaborator on the plugin :)
This topic has been closed to new replies.