Created
December 9, 2022 05:37
-
-
Save Archie22is/a652558acdcf5d8e10caf82aa1aaa331 to your computer and use it in GitHub Desktop.
Redirect WooCommerce Shop URL
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
<?php | |
// Redirect WooCommerce Shop URL | |
function shop_url_redirect() { | |
if( is_shop() ){ | |
wp_redirect( home_url( '/custom-page/' ) ); // Assign custom internal page here | |
exit(); | |
} | |
} | |
add_action( 'template_redirect', 'shop_url_redirect' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment