Thanks Luo,
That's got me moving forward again. I'm now using the Toolset WordPress archive as the archive for the case studies custom post type and taxonomy.
I'd like to display different content under the h1 heading using a conditional:
Is it possible to do something like this:
If case studies archive display:
Check out our case studies to see how we've helped our clients
If case studies taxonomy display:
Here are the case studies for our [wpv-archive-title]
I've been looking for the documentation on how to but don't know the syntax for this conditional.
Thanks for your support!
Hello,
Yes, it is possible with shortcode [wpv-conditional], for example:
1) Dashboard-> Toolset-> Settings-> Front-end Content
in section "Functions inside conditional evaluations", add WordPress function name "is_post_type_archive"
2) Edit the WordPress archive "Case Studies Archive":
hidden link
In section "Loop Editor", display different text like this:
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)"]<h2>Check out our case studies to see how we've helped our clients</h2>[/wpv-conditional]
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)" evaluate="false"]<h2>[wpv-archive-title]</h2>[/wpv-conditional]
More help:
Using custom functions in conditions
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/
Hello,
Yes, it is possible with shortcode [wpv-conditional], for example:
1) Dashboard-> Toolset-> Settings-> Front-end Content
in section "Functions inside conditional evaluations", add WordPress function name "is_post_type_archive"
2) Edit the WordPress archive "Case Studies Archive":
hidden link
In section "Loop Editor", display different text like this:
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)"]<h2>Check out our case studies to see how we've helped our clients</h2>[/wpv-conditional]
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)" evaluate="false"]<h2>[wpv-archive-title]</h2>[/wpv-conditional]
More help:
Using custom functions in conditions
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/
Here's the solution provided by Toolset support to display conditional content for a custom post archive and a taxonomy archive of that same custom post.
Our custom post type slug is case-study and when we this condition is evaluated as false then we display the second line where we also insert the taxonomy archive title. So when we're on the taxonomy archive of our custom post we'll see something like: Here are the case studies for our "new website package" - new website package being our taxonomy archive title.
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)"]<h2>Check out our case studies to see how we've helped our clients</h2>[/wpv-conditional]
[wpv-conditional if="(is_post_type_archive('case-study') eq 1)" evaluate="false"]<h2>Here are the case studies for our [wpv-archive-title]</h2>[/wpv-conditional]