
The wp_list_pages fnction is very useful, but sometimes it can be a bit frustrating, for exemple when you want to insert characters as such as “//” between menu items. Happilly, here is the solution to this problem.

The wp_list_pages fnction is very useful, but sometimes it can be a bit frustrating, for exemple when you want to insert characters as such as “//” between menu items. Happilly, here is the solution to this problem.
To apply this hack, simply paste the following code where you want your menu to be displayed.
<?php
$char = ' \\ ';
wp_list_pages('link_before=<li>&link_after='.$char.'</li>');
?>
Found on WordPress Codex.
By the way if you're a WordPress blogger interrested in finance and investment, you should definitely read this post I wrote yesterday on cats Who Code.
8 Responses
I didn’t tried to enter that kind of characters, but if I’ll try I’ll know how to do it. Useful!
Wow. Simple as hell. Yet, I would’ve never thought of that. I’ll try to use it in an upcoming theme.
Simple, yet very useful!
Hehe, sweet one indeed. Surely not so widely used, but if you come to this problem, very useful. Thanks for sharing.
Hello it’s working but some bug in that code
“page” word appear in the top in right side of the menu so update your code
NEW CODE
<?php $new = ‘ – ‘; wp_list_pages(‘title_li=&link_before=&link_after=’.$new.”);?>
I need other help
how can i remove last link “-”
Trackbacks: