| Home | Forum | Advertise | Contact Me | About WPTavern | WPWeekly Show Info |
![]() |
| |||||||
| Troubleshooting Need help with WordPress? Post here |
![]() |
| | Share | LinkBack | Thread Tools | Display Modes |
| ||||
| Quote:
There's no way to tell the function to put any text between list items. But, you can very easily use CSS to style both the list (UL) and the list items (LI). By default, the function wraps everything in a UL class="pagenav", and assigns class="page-item" to each of the LIs. So, you could approximate a pipe between list items by styling the right/left border property for LI.page-item. See here for more information. cbnet Plugins |
| |||
| Quote:
That's what I am doing, but I thought should such functionality exist, it would be useful to know. It seems to me that such an argument would be a welcome addition to wp_list_pages |
| ||||
| Quote:
You could use the text_before or text_after parameters, but they place text inside the link (A) tags, and I'm sure that wouldn't be what you're after. cbnet Plugins |
| |||
| Quote:
|
| ||||
| Well, it is called wp_list_pages() for a reason. :)
cbnet Plugins |
| ||||
|
The example I gave above isn't quite so useful to what you are doing. The following might be more useful since it should make use of the existing data: Code: <?php
function random_filter( $args ) {
$args = $args . 'I add this to the regular list';
return $args;
}
add_filter( 'wp_list_pages', 'random_filter' );
?>
|
| ||||
|
Sorry for the triple post ... To achieve the effect you are looking for, I usually apply a right hand border to the links. This gives the visual effect without having to modify the markup. It's rare that you would ever want anything but a list for a list of pages anyway. I use the last-child pseudo class to prevent it from displaying on the last list item, this obviously doesn't work in some browsers, but I don't worry about that these days since it's not exactly a mission critical part of the site. |
![]() |
| Thread Tools | |
| Display Modes | |
| |