Hi,
Welcome to Toolset support. This is indeed a custom coding request and is outside of our support scope.
We will not be able to delve into your code as it is not related with the functionality of Toolset itself.
I can give you some general suggestions but that is the extend that we can be of help here:
1. Adjust Flexbox Handling
Your .column class currently uses flex: 0 1 23%;, which might create alignment issues. Try updating it to:
.column {
flex: 1 1 calc(25% - 20px); /* Ensure consistent four columns with gap considered */
max-width: calc(25% - 20px);
box-sizing: border-box;
padding: 5px;
background-color: #f9f9f9;
border-radius: 4px;
}
@media (max-width: 900px) {
.column {
flex: 1 1 calc(50% - 20px); /* Two columns */
max-width: calc(50% - 20px);
}
}
@media (max-width: 600px) {
.column {
flex: 1 1 calc(100% - 20px); /* Single column */
max-width: calc(100% - 20px);
}
}
- The calc() function helps subtract the gaps dynamically, ensuring proper alignment.
- flex: 1 1 allows items to grow/shrink as needed without overflowing.
2. Fix Gaps and Spacing
Add uniform spacing using gap:
.wpv-loop {
display: flex;
flex-wrap: wrap;
justify-content: space-between; /* Ensures spacing adjusts dynamically */
gap: 10px;
}
Using justify-content: space-between; instead of center might help with alignment issues by evenly distributing items.
3. Fix WordPress View Structure Padding
Your wpv-loop structure currently adds empty columns ([wpv-item index=pad] and [wpv-item index=pad-last]), which can lead to unexpected layout shifts. Instead, remove them and use CSS :nth-child() selectors to handle styling.
Alternatively, you can keep the padding logic but ensure it's only added when necessary by dynamically checking the item count in WordPress.
4. Ensure Consistent Widths
Instead of using absolute pixel values for .artist-card, use percentage-based sizing to align with the flex grid:
.artist-card {
width: 100%;
max-width: 100%;
}
You are welcome to ask for help from a professional by hiring a developer using the link below:
https://toolset.com/contractors/
Thanks.