Site logo

Archived topic

Redirection for default woocommerce shop page

3 replies · Started by stardrive on August 17, 2015

Viewing posts 1–4 of 4

Dear Support,

Please, I noticed that the redirection function you gave me is working for other pages but is not working for the default woocommerce shop page: It does not redirect from the woocommerce shop page to my custom shop page.
See the code below:

function custom-shop_page_redirect()
{
if( is_page( 680 ) )
{
wp_redirect( home_url( '/custom-shop-page/' ) );
exit();
}
}
add_action( 'template_redirect', 'custom-shop_page_redirect' );

Please, kindly assist.

Regards,

Stardrive

That's not working because is_page() is a WordPress function and do not call the woocommerce pages, you just need to change it for: is_woocommerce( 680 ).

Should work now!

Great!!

It is OK now. Thank you, Jean.

Regards,

Stardrive

Great! :)

This archived topic is closed to new replies.