Title: Custom Taxonomy Shortcode
Last modified: June 20, 2017

---

# Custom Taxonomy Shortcode

 *  Resolved [Atlasfire](https://wordpress.org/support/users/atlasfire/)
 * (@atlasfire)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/custom-taxonomy-shortcode/)
 * Hi,
 * Is there a shortcode available to add custom taxonomy information into the template?

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

 *  Plugin Support [WP Lab Support](https://wordpress.org/support/users/wp-lab-support/)
 * (@wp-lab-support)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/custom-taxonomy-shortcode/#post-9245058)
 * Hello Atlasfire.
 * I am happy to assist you today.
 * Have a look at: [wplister_process_template_html](https://wordpress.org/support/topic/custom-taxonomy-shortcode/wplister_process_template_html?output_format=md)
   You or a developer should be able to take those example code snippets and modify
   to your needs to create a custom shortcode.
 * Kind regards,
    John
 *  Thread Starter [Atlasfire](https://wordpress.org/support/users/atlasfire/)
 * (@atlasfire)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/custom-taxonomy-shortcode/#post-9245117)
 * Sorry that link didn’t work? Where can I find the code snippets?
 * Kind regards,
 * Liz
 *  Plugin Support [WP Lab Support](https://wordpress.org/support/users/wp-lab-support/)
 * (@wp-lab-support)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/custom-taxonomy-shortcode/#post-9248020)
 * Hello atlasfire.
 * Sorry about that, forget that link. You can use the following and modify it to
   your needs. It registers a new custom shortcode that can be used in WPLA profiles.
   To use it, just enter [product_brands_list] to any of the profile fields and 
   it will be replaced with the brand(s) associated with the product.
 *     ```
       add_action( 'wp_loaded', 'register_product_brands_shortcode' );
   
       function register_product_brands_shortcode() {
           wpla_register_profile_shortcode( 'product_brands_list', 'Product Brands', 'my_product_brands_list' );
           WPLA()->logger->info( 'product_brands_list shortcode registered' );
       }
       function my_product_brands_list( $product_id ) {
           WPLA()->logger->info( 'my_products_brands_list for ID: '. $product_id );
           $brands_tax = wp_get_object_terms( $product_id, 'product_brand', array( 'fields' => 'names' ) );
           WPLA()->logger->info( 'Found brands: '. print_r( $brands_tax, true ) );
           if ( ! is_wp_error( $brands_tax ) ) {
               return implode( ', ', $brands_tax );
           }
   
           WPLA()->logger->info( 'Error gettings brands: '. $brands_tax->get_error_message() );
   
           return '';
       }
       ```
   
 * You will need to customize that based on your taxonomy. You can put the correct
   taxonomy in this line:
    `$brands_tax = wp_get_object_terms( $product_id, 'product_brand',
   array( 'fields' => 'names' ) );`
 * Kind regards,
    John

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

The topic ‘Custom Taxonomy Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/wp-lister-for-amazon/assets/icon-256x256.png?rev=2160056)
 * [WP-Lister Lite for Amazon](https://wordpress.org/plugins/wp-lister-for-amazon/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-lister-for-amazon/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-lister-for-amazon/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-lister-for-amazon/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-lister-for-amazon/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-lister-for-amazon/reviews/)

## Tags

 * [custom taxonomy](https://wordpress.org/support/topic-tag/custom-taxonomy/)

 * 3 replies
 * 2 participants
 * Last reply from: [WP Lab Support](https://wordpress.org/support/users/wp-lab-support/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/custom-taxonomy-shortcode/#post-9248020)
 * Status: resolved