Title: Undefined variable: post
Last modified: August 31, 2016

---

# Undefined variable: post

 *  [fanta00](https://wordpress.org/support/users/fanta00/)
 * (@fanta00)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/undefined-variable-post-2/)
 * I display the current taxonomy name above the product title. I added this code
   to title.php file :
 * `the_terms( $post->ID, 'xxx', '<span>', ' , ', '</span>' );`
 * It works fine, however when I switch debugging on I see this error:
    _Notice:
   Undefined variable: post in …/…/title.php_
 * Why is it appearing?
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/undefined-variable-post-2/#post-7072365)
 * Post is a global. Ensure its defined;
 *     ```
       global $post;
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Undefined variable: post’ 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/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/undefined-variable-post-2/#post-7072365)
 * Status: not resolved