Title: Attributes not clickable
Last modified: November 22, 2020

---

# Attributes not clickable

 *  Resolved [catheg](https://wordpress.org/support/users/catheg/)
 * (@catheg)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/attributes-not-clickable/)
 * Hi there,
 * I would like to reformat my list of attributes. With the code below, I have now
   a simple list, but I don’t want attributes clickable.
    The line is this in the
   code
 * $attribute_label = wc_attribute_label( $taxonomy );
    $html .= get_the_term_list(
   $product->get_id(), $taxonomy, ‘
    - ‘ . $attribute_label . ‘: ‘ , ‘, ‘, ‘
    - ‘ );
    - How can I do that.
    - Thx for your help.
    - Best regards.
    - Catherine.
    - The full code :
    - function MS_0001_attributes_shortcode( $atts ) {
    -  global $product;
    -  if( ! is_object( $product ) || ! $product->has_attributes() ){
       return; }
    -  // parse the shortcode attributes
       $args = shortcode_atts( array( ‘attributes’
      => array_keys( $product->get_attributes() ), // by default show all attributes),
      $atts );
    -  // is pass an attributes param, turn into array
       if( is_string( $args[‘attributes’])){
      $args[‘attributes’] = array_map( ‘trim’, explode( ‘|’ , $args[‘attributes’]));}
    -  // start with a null string because shortcodes need to return not echo a 
      value
       $html = ”;
    -  if( ! empty( $args[‘attributes’] ) ){
    -  foreach ( $args[‘attributes’] as $attribute ) {
    -  // get the WC-standard attribute taxonomy name
       $taxonomy = strpos( $attribute,‘
      pa_’ ) === false ? wc_attribute_taxonomy_name( $attribute ) : $attribute;
    -  if( taxonomy_is_product_attribute( $taxonomy ) ){
    -  // Get the attribute label.
       $attribute_label = wc_attribute_label( $taxonomy);
    -  // Build the html string with the label followed by a clickable list of terms.
    -  $html .= get_the_term_list( $product->get_id(), $taxonomy, ‘
    - ‘ . $attribute_label . ‘: ‘ , ‘, ‘, ‘
    - ‘ );
    -  }
    -  }
    -  // if we have anything to display, wrap it in a
 *  -  for proper markup
       // OR: delete these lines if you only wish to return the
    -  elements
       if( $html ){ $html = ‘<ul class=”MS-product-attributes”>’ . $html.‘
 * ‘;
    }
 *  }
 *  return $html;
    } add_shortcode( ‘display_attributes’, ‘MS_0001_attributes_shortcode’);

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/attributes-not-clickable/#post-13696579)
 * Hi there,
 * This is a fairly complex development topic. I’m going to leave it open for a 
   bit to see if anyone is able to chime in to help you out.
 * I can also recommend [the WooCommerce Developer Resources Portal](https://developer.woocommerce.com/)
   for resources on developing for WooCommerce.
 * You can also visit the [WooCommerce Facebook group](https://www.facebook.com/groups/advanced.woocommerce/)
   or the `#developers` channel of the [WooCommerce Community Slack](https://woocommerce.com/community-slack/).
   We’re lucky to have a great community of open-source developers for WooCommerce,
   and many of our developers hang out there, as well.
 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [5 years, 7 months ago](https://wordpress.org/support/topic/attributes-not-clickable/#post-13743857)
 * Hey there! No one has been able to chime in, so I’m going to close off this topic.
   If you need further support, I second RK’s recommendations above.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Attributes not clickable’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/attributes-not-clickable/#post-13743857)
 * Status: resolved