WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] link_before / link_after not working in WP 2.9.2 (7 posts)

  1. Mindshare Studios, Inc.
    Member
    Posted 4 years ago #

    wp_list_pages doesn't render link_before or link_after now that I've upgraded to 2.9.2!

  2. flying99koo
    Member
    Posted 4 years ago #

    I just found the same problem. At first I thougth it was my css code bug

  3. Mindshare Studios, Inc.
    Member
    Posted 4 years ago #

    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>
  4. Mindshare Studios, Inc.
    Member
    Posted 4 years ago #

    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.

    http://wordpress.org/extend/plugins/page-menu-editor

  5. iontxuen
    Member
    Posted 4 years ago #

    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.

  6. Maxaud
    Member
    Posted 3 years ago #

    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

  7. Sarah Anderson
    Member
    Posted 3 years ago #

    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 :)

Topic Closed

This topic has been closed to new replies.

About this Topic