Skip Navigation

[Resolved] Toolset Template – Edit the View of a Parent Taxonomy being displayed

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 0 replies, has 1 voice.

Last updated by dianeM 3 days, 4 hours ago.

Assisted by: Minesh.

Author
Posts
#2798535

Hello,

I opened a ticket that got resolved about a similar issue but I'd like to get more help on this.

On the following template page: hidden link
the specialties are being displayed with the parent taxonomy first and then the sub taxonomies. It was made possible through the following code:

function func_list_hierarchical_terms_single($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=list");

}
}
add_shortcode('show_tax_terms_hierarchical', 'func_list_hierarchical_terms_single');

However, at the moment the only way to see the difference in the hierarchical order is the indentation of the bullet point. Is there anything that we can do to make the parent taxonomy stand out more (Bold, move a bit left, etc.)?

Thank you for your help!

#2798604

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please send me admin access details and let me check what workaround I can offer.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2798721

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the following code to "Custom Code" section offered by Toolset - this code will add the class name "has_children" to every parent term :
=> hidden link

function func_add_category_parent_class($css_classes, $category, $depth, $args){
    if($args['has_children']){
        $css_classes[] = 'has_children';
    }
    return $css_classes;
}

add_filter( 'category_css_class', 'func_add_category_parent_class', 10, 4);

And with the single post content template - I've added the following custom CSS code:
=> hidden link

ul.children {
padding-left:20px;
}

.cat-item.has_children > a {font-weight: bold;}

More info:
- https://toolset.com/course-lesson/adding-custom-css-to-templates-archives-and-views/#steps-for-adding-css-to-a-content-template

#2798766

It works great, thank you!