/**
 * Theme Name:     Hello Elementor Child
 * Author:         Elementor Team
 * Template:       hello-elementor
 * Text Domain:	   hello-elementor-child
 * Description:    Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
 */

/*
Desenvolvido por Dante Testa
+ Fonte desse cabra aqui: https://rudrastyh.com/wordpress/terms-in-breadcrumbs.html
*/


function show_taxonomy_list() {

$nome_tax = 'nossas-solucoes'; 
	
$CSS='
<style>
.tax-style{    
    font-size:12px;
    color:#333333;    
}
</style>
';	
	
    

$rd_terms = wp_get_post_terms( get_the_ID(), $nome_tax, array( "fields" => "ids" ) ); // getting the term IDs
if( $rd_terms ) {
	$term_array = trim( implode( ',', (array) $rd_terms ), ' ,' );
	$neworderterms = get_terms($nome_tax, 'orderby=none&include=' . $term_array );
	$i=0;
	foreach( $neworderterms as $orderterm ) {
		//'<a href="' . get_term_link( $orderterm ) . '">' . $orderterm->name . '</a> » ';
		
		if($i<=count($orderterm)){
			$var1 .= $orderterm->name." » ";
		}else{
			$var1 .= $orderterm->name;
		}
		
		$i++;
	}
	
	return $CSS."<div class='tax-style'>".$var1."</div>";
}

}
add_shortcode( 'tax_list', 'show_taxonomy_list' );