I am trying to:
Adding conditional if by checking that the email address i have in my cpt field matches that of the user logged in.
It should only show those records which match the email address.
Also if i take out the conditional if and allow the system to show all records , I get a 2 by 2 listing on my page.
When i add the conditional if i get a single row listing .
Link to a page where the issue can be seen:
I expected to see:
I expect to see a 2 columns listing only showing the record relating to the user logged in matching the email address
So if i take the conditional if out the record display in 2 columns , but i have no filter.
With the conditional if i get a single column but filter does still not work as expected.
Hi, I don't recommend using conditionals in a View's loop for this reason - they can cause unexpected loop design problems. That's because conditionals are evaluated after the View's results are determined, which means the loop will then "skip over" some expected results that are hidden by conditionals.
Instead I recommend you add a custom field filter in the Query Filter section of this View. If you cannot see the Query Filter panel, scroll to the top right corner of the View editor screen and click "Screen Options". You can enable the Query Filter here. Add a new filter using the consultant email field, and set it to be equal to a shortcode attribute "email". Now you can pass the current User's email into the View as a shortcode argument. Find the shortcode used to insert this View, and add the current User's email using the wpv-current-user shortcode. Like this:
Hi
I have another question related to the same project.
I am using DIVI for the layout , using toolset grid.
See uploaded image
grid display 1 .. Why are the columns not the same size ?
grid display mobile .. What is the best why using div to get it to switch to stacking on mobile ?
Thanks
Tony
New threads created by Christian Cox and linked to this one are listed below:
Okay I have split your question about the grid layout into a separate ticket so we can discuss in more detail. Our policy is one topic per ticket, which helps keep things organized. I'll follow up in the other ticket shortly.
This issue was round the [wpv-conditional if="( [wpv-current-user info='email'] ne ' ' )"]
I changed that to : wpv-conditional if="( '[wpv-current-user info='email']' ne '' )"]