Skip Navigation

[Resolved] Display view when post reference field is not empty

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

Last updated by wimD-2 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2195651

Tell us what you are trying to do? I would like to display a view when post reference field is not empty. I don't seem to get the shortcode right.

Is there any documentation that you are following? I tried the different options I've found on the support forum, but none seem to work.

The view shows other content with the same parent. However, when no parent is chosen in the post reference field, the view shows a list of all content. So, the entire view either needs to display conditionally when the post recerence field is not empty OR the view needs to be adjusted so nothing is shown when the post reference field is empty. I think both solutions would work, but I cannot get one of these options to work.

Thank you for your help!
Wim

#2195793

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like to know how exactly you setup the post reference filter?

We can alter the query on fly using the view's hook "wpv_filter_query", If you can share problem URL and access details and tell me with what option it should display none results I would be happy to investigate this further and get back to you with possible solution or workaround.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2196695

I used the code I found on https://toolset.com/forums/topic/conditionally-display-post-reference-field/ and it works. I cannot see any difference with the code I used previously though.

My issue is resolved now. Thank you!