'null', ), $atts ) ); #tutti i termini associati all'eventuale speciale associato al post $terms = get_the_terms ( $post->ID, 'speciali' ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, 'speciali' ); $toc = $term->slug; if ( $toc <> $speciale ) { $content = null; } else { $q = new WP_Query( array( 'speciali' => $speciale, 'posts_per_page'=>-1 ) ); $header = '

Gli articoli dello speciale '.$term->name.'

'; if ( $q->have_posts() ) { while ( $q->have_posts() ) { $q->the_post(); $titolo = get_the_title(); $content .= '
  • '.$titolo.'
  • '; } /* ripristino */ wp_reset_postdata(); } $content = '
    '.$header.'
    '; } } $content = $content.$after_widget; if ( get_post_type() == 'post' ) { $out = $content; } else { $out = null; } return $out; } add_shortcode( 'tabspeciali', 'tabspeciali' );