Title: Compare Link Conditional Statement
Last modified: August 30, 2016

---

# Compare Link Conditional Statement

 *  [Chris Whiteley](https://wordpress.org/support/users/thewhite/)
 * (@thewhite)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/compare-link-conditional-statement/)
 * I would like to be able to show a link to the compare page within the header 
   of my site, but only when products have been added to the compare list. Something
   like:
 * `if ( has_comparison( ) { echo '<a href="link-to-compare-page">Compare</a>'; }`
 * Is there any kind of conditional statement I can use to check for comparisons
   and then present a link?
 * [https://wordpress.org/plugins/yith-woocommerce-compare/](https://wordpress.org/plugins/yith-woocommerce-compare/)

The topic ‘Compare Link Conditional Statement’ is closed to new replies.

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

 * 0 replies
 * 1 participant
 * Last reply from: [Chris Whiteley](https://wordpress.org/support/users/thewhite/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/compare-link-conditional-statement/)
 * Status: not resolved