I am trying to use a mixture of Wordpress and Wooommerce conditional tags to load content on certain pages within my site. However, the WooCommerce conditional tags do not seem to have any effect. In the below example, I am trying to NOT load some code if the user is logged in, or if they are on any WooCommerce page. It works if logged in, but does not take effect on WooCommerce pages?
I have also tried !is_checkout() and !is_account_page(), and neither take effect either?
<?php
// Do not display code if user is logged in OR on any woocommerce pages
if ( !is_user_logged_in() || !is_woocommerce() ) {
// CODE HERE
} ?>
Aucun commentaire:
Enregistrer un commentaire