This thread is resolved. Here is a description of the problem and solution.
Problem:
A View omits some results depending on the user role, but this leaves unwanted blank spaces in the grid output where posts are omitted.
Solution:
Bootstrap grids require a fixed number of elements per row, e.g. with 3 columns there should be 3 elements in each row.
The solution in this case is to create separate Views for the different role scenarios where all matching posts will be output so that the rows are filled out correctly, and then apply the role-based conditions where the Views are inserted to display one or the other.
This support ticket is created 6 years, 9 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.
- ALL items are displayed if a user is connected and have one of this role : administrator, editor, manager, agent
- If a user is not connected, only items with metafield "visible_sur_le_front" = 1 are displayed
Presumably it looks okay for the privileged roles.
The grid system expects 3 items per row, but you may omit some of the posts that would fill those slots, so it is inevitable that this won't work.
You would either have to replace the markup so that it doesn't use the Bootstrap grid and uses an alternative which doesn't require a fixed number of elements in rows, or, what I think is more viable for you...
Create two Views. One which displays all posts and then another which displays only those posts marked as visible on the front end.
Then apply the conditions where you insert the Views, so that either one of the Views will be inserted depending on the user role.