Created
February 15, 2015 11:15
-
-
Save iMazed/39aa5da50471cb74173b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to functions.php if you want a redirect to happen when the store is closed. | |
// Comment out when store needs to open again | |
add_action('template_redirect','store_closed'); | |
function store_closed(){ | |
if (!is_admin() && is_woocommerce()){ | |
wp_redirect('/store-closed/'); // Change store-closed to permalink you'd like to use | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment