Navigation überspringen

[Gelöst] Toolset Template – Parent Taxonomy is not being displayed on my page

This support ticket is created vor 1 year, 4 months. 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
- 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 0 reply, hat 1 Stimme.

Zuletzt aktualisiert von Minesh vor 1 year, 4 months.

Assistiert von: Minesh.

Author
Artikel
#2794366

Hello,

I've created a template through Toolset to show each Arbitrators' bio. See the following example: versteckter Link

When creating the Template, I've chosen to display their Specialties in a box on the left. However, it's not showing the Parent taxonomies for Specialties but rather display all Specialties (parent and sub taxonomies mixed together and separated by a coma).

How can I change this so it displays the Specialties as follow:

Commercial
> Collection, Debtors
> Contracts
Employment
>Workplace Disputes
>Wrongful/Constructive Dismissal

Thank you for your help!

#2794371

Minesh
Unterstützer

Sprachen: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please tell me how exactly you are displaying those specialities? Do you want to display only parent specialities terms or something else?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2794430

Minesh
Unterstützer

Sprachen: Englisch (English )

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

Ok - so on single post content tempalte you want to display the terms attached to posts in hierarchical manner.

What if you try to add the followig shortcode to "Custom Code" section offered by Toolset:

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');

And you can call the above shortcode as given under by adding shortcode block to your content template:
=> versteckter Link

[show_tax_terms_hierarchical taxonomy="specialty" separator=""] 

More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/

#2794446

Thanks for your prompt response!

I've added the Custom code and the shortcode but it's not working.

#2794564

Minesh
Unterstützer

Sprachen: Englisch (English )

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

Can you just go to Toolset => Settings => Custom Code and activate the code snippet you added and check if that help you to resolve your issue.