Skip Navigation

[Resolved] Divi css problem and display taxonomy terms hierarchically

This thread is resolved. Here is a description of the problem and solution.

Problem:
1. In this page and in all that I use a toolset layout, the page header change is colour to #ffffff instead #88d0c9 as should be by Divi Theme. You can see if you click other menus.

2. On this page http://apmredemut.pt/associacoes/mutualidade-da-moita-am/ I list the taxonomies associated to that post (associacao). But the hierarchy is not reflected in the way it appears. I would like to show them organized as I made in the sidebar view.

Solutions:
1. Update to the latest versions of Divi and Toolset plugins
2. Create a View of your custom Taxonomy. Add a Query Filter to filter by parent term. Select parent is "None". Then in the Loop Output editor, output the taxonomy title using the [wpv-taxonomy-title] shortcode.
Then create another View of your custom Taxonomy. Add a Query Filter to filter by parent term, and select "Parent is the taxonomy selected by the parent Taxonomy View". Then in the Loop Output editor, output the taxonomy title using the [wpv-taxonomy-title] shortcode.
Next, return to the first View, and add your 2nd View inside the Loop Output just after the [wpv-taxonomy-title] shortcode.

You can add as many nested Views as you need to achieve the hierarchical structure of your taxonomy. A nested unordered list can be used to set up indentation if you'd like.

Finally add a filter to each View: "Taxonomy Term is set by page where this View is inserted". This will limit the terms to only those associated with the post.

More information about nested Views here:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by raulE-2 7 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#587732

Hello!

I have some difficulty using toolset:

-removed by admin-

URL: hidden link

1 - In this page and in all that I use a toolset layout, the page header change is colour to #ffffff instead #88d0c9 as should be by Divi Theme. You can see if you click other menus.

2- On this page hidden link I list the taxonomies associated to that post (associacao). But the hierarchy is not reflected in the way it appears. I would like to show them organized as I made in the sidebar view.

How can I show the taxonomies with their hierarchies? Should I use a view for that or there is any function I can add?

#587767

Hi, I'll be glad to take a look. I tried to login using the credentials you supplied, but I couldn't access wp-admin. Can you check for me?

Also - it's not a good idea to post login information in the main ticket contents or comments, since those are visible to the public. I've removed those for now, and I will activate private reply fields here in case you need to share login credentials in confidence. Thanks!

#587821

1. I see your parent theme and Toolset plugins are out of date, and there have been some recent changes that help make Layouts and Divi more compatible. Is it possible to update these before trying to debug this issue further? Make a backup of your site before attempting to update everything.

2. If you just want to reorder the list of terms in hierarchical order, then you can add this custom shortcode to your functions.php file:

function list_hierarchical_terms($atts) {
    global $post;
    $taxonomy = $atts['taxonomy'];
    $separator = $atts['separator'];
    $terms = wp_get_object_terms( $post->ID, $taxonomy, array( "fields" => "ids" ) );
    if( $terms ) {
        $terms = trim( implode( ',', (array) $terms ), ' ,' );
        return wp_list_categories( 'title_li=&taxonomy=' . $taxonomy . '&include=' . $terms."&hierarchical=1"."&separator=".$separator."&echo=0&style=none");

    }
}
add_shortcode('display_post_tax_terms_hierarchical', 'list_hierarchical_terms');

Then in your Layout, instead of using wpv-post-taxonomy to display the Valencia taxonomy terms, you can use your custom shortcode:

[display_post_tax_terms_hierarchical taxonomy="valencia" separator=", "]

If you want to display a more complex design, like a hierarchical outline or tree, then you will need to use a View or a combination of Views to show the relevant terms.

#588324

Hi!

The problem with the header is solved with the update as you suggest me.

But concerning to taxonomies, is not that. I want to list them as a hierarchy list.

Taxonomy 1
taxonomy 1.1
taxonomy 1.2
taxonomy 1.3
Taxonomy 2
taxonomy 2.1
taxonomy 2.2
.......

#588332

Okay you must use nested Views to accomplish this.
- Create a View of your custom Taxonomy. Add a Query Filter to filter by parent term. Select parent is "None". Then in the Loop Output editor, output the taxonomy title using the [wpv-taxonomy-title] shortcode.
- Create another View of your custom Taxonomy. Add a Query Filter to filter by parent term, and select "Parent is the taxonomy selected by the parent Taxonomy View". Then in the Loop Output editor, output the taxonomy title using the [wpv-taxonomy-title] shortcode.
- Return to the first View, and add your 2nd View inside the Loop Output just after the [wpv-taxonomy-title] shortcode.

You can add as many nested Views as you need to achieve the hierarchical structure of your taxonomy. A nested unordered list can be used to set up indentation if you'd like. Let me know if you have additional questions about that.

More information about nested Views here:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

#588338

That is what I have made in the sidebar to list all taxonomies.

I want to do the same but listing only the taxonomies associated with that post.

How can I create a view listing just the taxonomies of that post?

#588925
Screen Shot 2017-11-12 at 10.36.27 AM.png
Screen Shot 2017-11-12 at 10.36.36 AM.png

You can do this by adding a second filter to each View: "Taxonomy Term is set by page where this View is inserted". This will limit the terms to only those associated with the post.

#589561

Thank you