I am trying to: Display taxonomy description even if there are no results for in the taxonomy: hidden link
Take a look at our Certified Therapist Training Taxonomy in the sidebar.
It has 5 levels. Level 2, 4 and 5 have posts assigned to them. But levels 1 and 3 have no posts assigned to them. But even if there are no posts in a level we still want the description to display. Then a message saying there are currently no trainings for this level.
At the moment I've using this:
[wpv-no-items-found]
<p>[wpv-post-taxonomy type="certified-therapist-training" format="description"]</p>
<p>[wpml-string context="wpv-views"]We have no upcoming trainings at the moment. Join our community and we'll keep you in the loop about future training courses and workshops.[/wpml-string]</p>
[/wpv-no-items-found]
But this appears outside the WordPress loop so I can't use the taxonomy description in this block.
I've tried removing this block and using a conditional tag within the content template:
I've tried adding a conditional in the content template to display different content.
[wpv-conditional if="( '[wpv-items-count]' gt '0' )"]
Thank you for contacting Toolset support. For this should need to add shortcode and text within [wpv-no-items-found] shortcode, replacing the text “No items found” -- first check it by only replacing this text to see if it works in your site and later add the shortcodes.
1. Please Edit View >> in Query Options >> Please disable this option “Don't show empty terms” -- screenshot attached.
2. Please use this shortcode for Taxonomy Description:
[wpv-no-items-found]
<p>[wpv-taxonomy-description]</p> //This is the description that is not showing up
<p>[wpml-string context="wpv-views"]We have no upcoming trainings at the moment. Join our community and we'll keep you in the loop about future training courses and workshops.[/wpml-string]</p>
[/wpv-no-items-found]
And now its working good for Empty Taxonomy Terms as well: hidden link hidden link
The updated code in the View Loop is:
[wpv-no-items-found]
<p>[wpv-taxonomy-archive info="description"]</p>
<p>[wpml-string context="wpv-views"]We have no upcoming trainings at the moment. <a href="/email-sign-up" title="Sign up to our email list to stay in the loop">Join our community</a> and we'll keep you in the loop about future training courses and workshops.[/wpml-string]</p>
[/wpv-no-items-found]
I hope its all good now, please let me know. Thank you