Hello
I’m talking about the submenu that is displayed inside pages (right or left Columns)
I would like to add for each LI a top and bottom border
it’s easy to do but as there is no CSS class to indicate something like firt-item-menu / last-item-menu
the borders are double.
How can i change the php code that generate this menu to add this classes ?
Thanks
If it was possible to have a menu like this:
Hi!
You can use css to style first last using pseudo selectors: http://css-tricks.com/pseudo-class-selectors/
The menu in your second reply isn’t a menu but instead a tab shortcode: http://kriesi.at/themes/enfold/shortcodes/tabs/
Regards,
Devin
Hello Devin
It seems that you did not understand me and sure it’s possible with my very bad english but:
1/ yes i know that this it not a menu but a shortcode tabs :) but I wanted just to show you the result i woulk like to have
2/ :last pseudo selector is not crossform web browser (as far i know) except if I use selectivizr JS plugin
No chance you give me how to modify the php code that output the html submenu ?
thanks
Hey!
You can try a code I found here: http://www.willchatham.com/web-dev/wordpress-2/wordpress-first-last-navigation-items/ – it will basically use the wp_list_pages filter and preg_replace to add a class to the first/last li element:
function add_markup_pages($output) {
$output= preg_replace('/page-item/', ' first-page-item page-item', $output, 1);
$output=substr_replace($output, " last-page-item page-item", strripos($output, "page-item"), strlen("page-item"));
return $output;
}
add_filter('wp_list_pages', 'add_markup_pages');
Insert it at the bottom of functions.php.
Best regards,
Peter
Great :-) Thank you
I keep this code snippet for later.
Meanwhile, I just used the :last-child pseudo selector and simple border-top on LI tags to style my submenu: