Dynamic Content Shows Parent Category Instead of Main Cateogry

Hi Team,

I’m using {{dc:term:name}} but instead of showing the most specific category (e.g., the city), it always displays the top-level parent category (e.g., “Destinations We Visited”).

Example category structure:
-Destinations We Visited (parent) / Destinos que visitamos (In spanish)
–Country Name
—City Name (this is what I need to display and is already selected as “main category” form the post editor)

Question:
How can I modify Dynamic Content to always return the most specific category assigned to a post?
image

Thanks for your help!

Hey Ignacio,

Thank you for the very detailed post information. Be advised that you cannot simply use the {{dc:term:name}} dynamic content in a post item. Be advise that you can assign several categories, tags or taxonomies to a post item. You will need to have a Looper Provider Current Post Terms to be able to loop through the taxonomies. I would highly recommend that you use the Terms(minimal) element and change the provider. Like in this demo:

You should have something like this:

Hope this makes sense.

Hi and thank you very much for your response. To better illustrate the issue, I’m attaching some screenshots where you can see the difference between what WordPress allows me to select as the “Main Category” and what is actually displayed on the website.

It seems that the categories are being ordered randomly instead of following the hierarchy I have set. In some cases, an intermediate category is shown instead of the one that should appear based on the defined structure or the manually selected main category in WordPress.

If there is a way to adjust this behavior so that dynamic content respects the correct structure and the chosen main category, I would really appreciate any guidance.

(Provider Settings):

Hello Ignacio,

The categories or taxonomies will display in alphabetical order regardless of its parent-child relationship or no relation at all. If you want to display in a specific order like parent category first then the child or no relation, you may need to use Looper Provider Custom and have a custom PHP code to that for you. Kindly check out this old thread instead:

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.