The $atts
in your template part (templates/show-taxonomy.php
) that you passed to shortcode_atts()
is not defined, so you need to define it by passing it via the third parameter for get_template_part()
like this:
get_template_part( 'templates/show-taxonomy', '', array( 'atts' => $atts ) );
Then in the template part, use $args['atts']
to access the shortcode parameters:
$atts = shortcode_atts( array(
'custom_taxonomy' => '',
), $args['atts'], 'atributes' ); // here, use $args['atts'] and not $atts
And actually, in the above shortcode_atts()
call, the third parameter should be cat_widgets
(i.e. the 1st parameter for add_shortcode()
) and not atributes
. 🙂