[wp-hackers] splitting dynamic_sidebar()
Jackson Whelan
jw at jacksonwhelan.com
Thu Jul 21 15:37:50 UTC 2011
On Jul 21, 2011, at 11:31 AM, Christopher Ross <cross at thisismyurl.com> wrote:
> My worry is that the footer only has the width for three widgets, if somebody adds a fourth it will wrap but not always to the start of the second row.
>
> For example if the widgets look like:
>
> 111111 222222 333333
> 111111 222222 333333
> 111111 222222 333333
>
> The fourth widget will wrap like this:
>
> 111111 222222 333333
> 111111 222222 333333
> 111111 222222 333333
>
> 444444
> 444444
> 444444
>
> But if the third widget is short, it'll wrap like this:
>
> 111111 222222 333333
> 111111 222222 444444
> 111111 222222 444444
> 444444
>
> What I want to do is insert a clear:right; after the third widget. Which will look like:
>
> 111111 222222 333333
> 111111 222222
> 111111 222222
>
> 444444
> 444444
> 444444
>
> If I know what it is, I can do it using the specific widget name but when users can add anything, there isn't an ID or class for 'widget-3', so ... is there another method?
>
> Chris
You could use jQuery to add a class to the third list item
http://api.jquery.com/nth-child-selector/
Jackson
More information about the wp-hackers
mailing list