Skip Navigation

[Resolved] Split: Custom field showing in the incorrect post type

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by johnC-6 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2613037

Hi again,
It seems the question mark issue has resolved itself but I have another issue. I created a custom field called "Review Issue" for the Review post type. For some reason that custom field is also showing up in the search results in other post types.

#2613055
post-type-conditional-check.png

Hi,

If I understand correctly, you'd like to show the 'Review Issue' field in the 'Search Test' page's results, only if the post type is 'Reviews'.

To achieve this, you can add a 'Conditional' block that checks for the current post's type and only shows the inner content if it is equal to 'review', the slug of post type 'Reviews'.
( example screenshot attached )

Next, you can drag the 'Fields and Text' block that shows this field, inside the newly added conditional block, so that it only shows when the condition is true.

Here is a guide on using the conditional block:
https://toolset.com/lesson-placement/lesson-placements-1621067-1292451/

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2613127

Hi Waqar,
What do I put in the Fields and Text block? I tried putting in a shortcode for the custom field but that didn't work.
This is what I entered: [types field='review-issue'][/types]
John

#2613499

I've checked the search results page and the conditional block is correctly working to show the review issue, only for the 'Reviews' posts.
( screenshot: hidden link )

Looks like you've managed to make it work, after writing to us.

Let me know if you have any follow-up questions and for a new question or concern, you're welcome to start a new ticket.

#2613507

Hi Waqar,
I guess it was a caching issue on my end because I couldn't see it was fixed. Thanks!