Why not use CSS to add your separators then remove the last one using the pseudo :last-child selector?
Thread Starter
hAtul
(@free269)
How exactly can I do this with this option?
I can’t really understand
Thread Starter
hAtul
(@free269)
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'link_after' => '</a> <span class="dot">·</span>' ) ); ?>
.nav-menu > li:last-child{
.dot{
display: none;
}
}
* not all the list items have the same class
So.. where is my mistake?
Thread Starter
hAtul
(@free269)
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'link_after' => '</a> <span class="dot">·</span>' ) ); ?>
.nav-menu > li:last-child{
.dot{
display: none;
}
}
* Not all the list items have the same class name. if it matters for some reason…
So.. what is my mistake?
Apply the dot using CSS and then remove it on the last item via :last-child.
#Free269 Your really close just remove that nesting in the CSS:
.nav-menu > li:last-child .dot {
display: none;
}
Regarding #esmi comments:
Sometimes adding bullets via CSS can be unpredictable on older browsers, as well as different media platforms such as tablet and iPhone… although the method mentioned above is cumbersome it does degrade better in older browsers. Could you provide some CSS you felt worked well for this purpose #esmi? thanks!