Hello,
How do you setup those custom post types "wow-classic/news" and "tbc/news"?
There should not be "/" characters in the post type slug, please check these:
1) Find and edit those two post types "wow-classic/news" and "tbc/news", make sure your are using correct slugs
2) Edit the codes you mentioned above, use the same post type slugs.
Those are the correct slugs, as I mentioned it was working perfectly until the most recent update.
Anyway, I've tried using both "wow-classic-news" and the one that was working until now which is in the rewrite "wow-classic/news" and neither are working. Attached a screenshot.
Please try to output the [wpv-post-type] shortcode directly, test it in frontend, then use the frontend result in the [wpv-conditional] shortcode, and test again
It outputs fine without the conditional in place.
I understand what you mean now, took me a few.
However [wpv-post-type] outputs "wow-classic/news" and "tbc/news"
If I try to use [wpv-conditional if=" ( ( 'wow-classic/news' eq 'wow-classic/news' ) ) " ] it just outputs that result for everything.
I have tried the same setting as your screenshot in my localhost(fresh WP installation + the latest version of Toolset plugins)
https://toolset.com/wp-content/uploads/2021/05/2048421-toolset1_1.jpg
The codes you mentioned above works just fine:
[wpv-conditional if="( '[wpv-post-type]' eq 'wow-classic/news' )"]
<a href="/wow-classic/"><img src="/wp-content/uploads/2020/12/classic.png" alt="WoW Classic News" title="WoW Classic News"></a>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'tbc/news' )"]
<a href="/tbc/"><img src="/wp-content/uploads/2020/12/tbc.png" alt="TBC Classic News" title="TBC Classic News"></a>
[/wpv-conditional]
It does output different image on different post type.
So the problem you mentioned above is abnormal, please check these:
1) Add debug="true" attribute in [wpv-conditional] shortcode, try to debug the problem in your website:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again
3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
You can also provide a test site with the same problem, I need to test and debug it in a live website, thanks
Thanks for the details, I have done below modifications in your website:
Edit the problem page:
hidden link
Replace the "Fields and Test" block with a shortcode block, copy/paste the same codes into it:
[wpv-conditional debug="true" if="( ( '[wpv-post-type]' eq 'wow-classic/news' ) ) " ]
<a href="/wow-classic/"><img src="/wp-content/uploads/2020/12/classic.png" alt="WoW Classic News" title="WoW Classic News"></a>
[/wpv-conditional]
[wpv-conditional debug="true" if="( '[wpv-post-type]' eq 'tbc/news' )"]
<a href="/tbc/"><img src="/wp-content/uploads/2020/12/tbc.png" alt="TBC Classic News" title="TBC Classic News"></a>
[/wpv-conditional]
It works fine, please test again, check if it is fixed, thanks
That outputs the conditionals correctly but breaks all the styling and seems to be adding a paragraph tag and two line breaks.
Is there any reason the recent update caused the "Fields and Test" block to stop working properly?
I got it working, I used two conditional blocks, one for each post type.
Thanks
My issue is resolved now. Thank you!