warpanda
Forum Replies Created
-
Eliot,
It works perfectly the way I needed !!! This is awesome!!!
Thank you much for your help and time helping me throughout this issue.
It’s very interesting to see how Custom Content Shortcode works.
1) The issue with the original code was that it listed all the posts including posts that are in another category
2) The second code fixed it by checking the category but for some reason, based on my example above, displayed the terms Overview / Symptom / Cause on other categories even when there were no terms assigned.
Which mean that it will show correctly under “Diabetes” category :
Overview
Post 1 titleSymptom
Post 2 title
Post 3 titleCause
Post 4But on post under, for example, “Lifestyle” I’ll just see the taxonomy term displayed even when no terms is assigned:
Overview
Symptom
Cause3) The 3rd code fixed that but also took out the ability to see the listing on Post 5 and Post 6 (based on my example above) So I was wondering how can I display the listing on all posts within the same category. 🙂 By category I meant posts that share the category such as “Diabetes” ( I’ve also mentioned a workaround, so if I want to see the listing on Post 5 and 6 I will have to assign them to a terms from disease_section)
Sorry if it’s still confusing after my explanation ;( If so I’ll try to draft our visually what I’m trying to accomplish it would be much easier.
Thank you for your patience in helping solving this case further 😉
Let me try to explain it better…
Let say I have a category name “Diabetes”
“Diabetes” has
Post 1 (overview)
Post 2 (symptom)
Post 3 (symptom)
Post 4 (cause)
Post 5 (no taxonomy term attached)
Post 6 (no taxonomy term attached)So the listing with custom content shortcode generate the following list :
Overview
Post 1 titleSymptom
Post 2 title
Post 3 titleCause
Post 4 titleAt the moment the listing is only present on posts that has taxonomy term attached, therefore I would not see the listing in Post 5 and Post 6. So, I was trying to find a way to also show that listing inside Post 5 and Post 6.
I hope I was able to clarify the issue I was trying to solve.
Yes [for each=”disease_section” current=”true”] do what I need. Which is not show [each name] when there’s no term attach to the post. (which is needed for post that doesn’t have term attached)
But, I would like to display the listing on all posts within the same category, even if there’s no term attached to it.
It’s a medical website, posts are use for both Diseases and Lifestyle articles.
Posts under Diabetic will be assign as Cause, Symptom, Prevention, etc… and I’ve used Taxonomy do it (should I used custom field instead?). Lifestyle articles will not be assign to a custom Taxonomy.
I think the only workaround is to always assign a Taxonomy to a Disease post then it will solve the problem.
Again, thank you for taking the time to understand the issue and helping throughout this process. In any case, I’ve became much more proficient with Custom Content Shortcode, thanks to this issue and I’ve been going through the documentation lots. 😉
Eliot,
Thank you, the code that you’ve post earlier works now. It’s even better than what I needed!
At first, all I wanted was not to show the title [each name] when there’s no taxonomy assign but still show it when in same category.
Could you explain why adding empty=”false” inside [for each=”disease_section”] didn’t work ?
[pass] [if pass="{CATEGORY}" empty="false"] [for each="disease_section" empty="false"] [each name] [loop type="post" category="{CATEGORY}"] [field title-link] [/loop] [/for] [/if] [/pass]I thought that it would have work as “For each taxonomy that is not empty print [each name], therefore if there is not a taxonomy don’t print it”
Not only the post titles are blank but also the taxonomy [each name] is not showing. There’s no displayed datas.
Thanks you for the advice on the single-post.php.
Guess that’s the reason I wasn’t able to find a plugin that can manage this sort of listing. 😉
Unfortunately, the result is blank. ;(
Thank you in advance for your help once more.
Eliot,
While implementing it throughout the whole website, I’ve notice that some post doesn’t have the custom taxonomy.
So, [each name] should not be shown on those posts.
How do I tell CCS not to display [each name] when custom taxonomy is empty ?
I’ve tried current, empty, [if empty] , [else]
Again, thank you for your support and time.
Eliot,
Yes and sorry that I could have not explained clearly enough. 😉
It is exactly what I need and works wonderfully ! Thank you for your prompt reply and time.
I will now try to implement it throughout each post on our website.