[wp-hackers] Detailing content listing
Jason LeVan
jason at blueluna.com
Sat Jul 3 20:45:27 UTC 2010
On Sat, Jul 3, 2010 at 4:26 PM, Vinicius Massuchetto <
viniciusandre at gmail.com> wrote:
> On Sat, Jul 3, 2010 at 3:21 PM, scribu <scribu at gmail.com> wrote:
> > On Sat, Jul 3, 2010 at 7:10 PM, Vinicius Massuchetto <
> > viniciusandre at gmail.com> wrote:
> >
> >> Hi!
> >>
> >> I've been running through some problems while styling menu items
> >> generated by `wp_list_pages` or `wp_list_categories`, mostly because
> >> of the lack of classes that map things like odd, even, first or last.
> >>
> >
> > Come on, you need classes for odd, even, first or last?
>
> No, I don't. I just would use PHP code to generate classes instead of
> applying styles with jQuery if I could, and leaving the page rendering
> the less possible "user-side".
>
> > I thought we already
> > have CSS selectors for that.
>
> Unfortunately, IE does not support :first and other CSS selectors...
> And I don't think it's nice to load jQuery just to apply some colors.
>
> One could also argue that it's not nice to run unnecessary loops just to
cater to styling a browser without updated CSS support, and that needing to
add extra classes to the HTML just to apply extra colors is extraneous
markup.
Bottom line, you have to use a "messy" solution either way to have these
selectors cross browser, either extra markup and loops in your PHP, or using
jQuery(or vanilla javascript if you need a more lean solution) - although
using Google's CDN for jQuery will mean that most users have the jQuery
library cached already anyway.
--
———————
jason levan
BlueLuna
617.938.3944 x709
www.blueluna.com
More information about the wp-hackers
mailing list