Skip Navigation

[Resolved] Conditional that must equal date field of parent.

This support ticket is created 2 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by matthieuB-5 2 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2471193

Hi

I am trying to make a conditional that shows a different image when the date of the loop item parent is different on an event.

Friday = image 1 (dark host logo)
Saturday = image 2 (light host logo)

i have got the 'ne' conditional to work:

[wpv-conditional if="( $(wpcf-event-date).item(@host-event.parent) ne '1668124800' )"]
<img src="[types field='logo' size='full' item='@host-event.parent' url='true'][/types]" width="30px" ></img>
[/wpv-conditional]

Not i am looking for the solution to make the 'eq' friday work.
this is the raw timestamp of the date field: 1668124800.

The image shows on the ne but not on the eq, what im a doing wrong?
can you help me out?

Thanks!

#2471309

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

First of all, I will have to review how the data is stored for your custom date field.

Can you please share problem URL where you added the conditional statements as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2471827

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I understand now, you have single artist elementor template using which you display the single artist post:
- hidden link

I noticed that you have many-to-many post relationship between artists and Event post types.

Now, what you want is you want to get related event information of above single artist where the related event holds the 5"Event Date" value and you want to compare this "Event Date" value with equal to but with what value? Event date == what value (custom field)?

Also, I see the logo is coming from another relationship that is "Host Event" so the way we will require to work is:
- Get the related event based on current single artist post
- Based on the found related event get the "Event Date" and with that value we need to compare it?
- Based on found related event, we should get the logo - right?

#2474691

Hi Minesh

I fixed the problem in a different way, instead of using a conditional to replace the image file i used the svg code and css to change the color on hover.

Thank you!