Skip Navigation

[Resolved] Loop div too large

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by NellyK1283 4 years ago.

Assisted by: Nigel.

Author
Posts
#1594775
screenshot.png

Hey Toolset team,

I need some help with styling my loop. I have a list of previous concerts displayed here:
hidden link
Please take a look at the right column just above the footer (Минали концерти). My loop contains 132 items (132 concert dates in the past). I used some javascript to initially show only 5 of them. Every time the user clicks on the "show more" button (Виж всички) 5 more will show up. The problem, as you can see, is that the button is not positioned after the last displayed item of the loop but bellow the entire div. Somehow I didn't manage to set the div height according to the number of the items shown.

I will highly appreciate if you can help to solve this issue.

Thank you in advance,
Nelly

#1595301

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2020-04-22 at 09.09.04.png

Hi Nelly

Looking at the source code (screenshot) I can see that you are outputting these results as spans (which are inline elements and don't display on a new line) and so you are adding br tags to create the line breaks between them.

You then hide many of the spans with display: none, but the br tags are still displayed, so the result is lots and lots of br tags creating new lines.

I'm not sure why you are using spans and br tags.

Why not just output the results inside div tags which will make the br tags redundant because they start on a new line anyway.

Then when you hide the divs the space will collapse.

#1599491

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.