[Resolved] Repeatable regions loop is adding empty items
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here was that the user's view was adding empty items to their loop on the frontend
Solution:
The reason for this was that the user had also selected another CPT on their view which did not have the custom fields that they were displaying.
This had caused the view to display an empty div whenever data for that CPT is to be displayed.
This support ticket is created 4 years, 10 months 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am using these repeatable regions for the very first time trying to create a restaurant menu with dishes and prices.
I notice in my loop for the aperitieves, that although I have 1 item with 3 fields, there are 3 empty fields in front of that.
Hi Shane,
I had to read your answer a few times, but i am afraid it don't quite understand what you are saying.
I have added another screenshot where you can see that for "aperitieven" there are no blank fields.
This issue is not present for "voorgerechten", even though I duplicated the first view to create the "voorgerechten" view.
On a sidenote, is this the best way to create a restaurant menu? Creating 1 CPT "Menu" with repeatable regions and then creating different views for aperitieves, starters, mains, desserts?
The issue was that you were displaying the Menu CPT along with the specific menu items as well. That is why the empty items were being displayed as well.
Ok, brilliant, that fixed it. As I said, this is the first time I am using Repeatable Groups.
I have another issue where I added a second repeatable group to a Post Fields Group when I realised I'd better create a 2nd Fields Group for that new repeatable group, so I deleted that repeatable group from the first Fields Group, created a second Group and inserted the repeatable group again, but the system now says that that slug for the repeatable group has already been used, even though I cannot find that group anywhere.
It is also visible in my View, where "voorgerechten" is the old repeatable group and "voorgerechten2" is the new one. How do I delete the old one?
New threads created by Shane and linked to this one are listed below: