Does anyone know how to put code into your theme that will only shop up on WooCommerce pages? I want to add a cart link but don't need it to shop up on the rest of the site. Thanks!
2 Answers
If I understood correctly what you need no do is override WooCommerce templates. You can do this in your theme/child-theme directory. More detailed documentation can be found here --> https://docs.woocommerce.com/document/template-structure/
If you need further assistance please don't hesitate to ask.
You can simply put your code in the is_woocommerce()
conditional tag.
Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included).
For example:
if ( is_woocommerce() ) {
enter code here
}
Read more information about WooCommerce Conditional tags at https://docs.woocommerce.com/document/conditional-tags/