Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 你好我想将类别页面从Woocomece重定向到另一个页面_Wordpress_Url_Redirect_Categories - Fatal编程技术网

Wordpress 你好我想将类别页面从Woocomece重定向到另一个页面

Wordpress 你好我想将类别页面从Woocomece重定向到另一个页面,wordpress,url,redirect,categories,Wordpress,Url,Redirect,Categories,我想重定向Woocomece中的某个类别,因此当它被访问(单击它)时,会将用户引导到我选择的wordpress页面,而不是默认的产品页面。我的类别是:/laptop repair,我想单击它时访问该页面 :膝上型电脑修复/这是在wordpress中创建的页面。我希望您能帮助我执行以下功能:\u 38101215\u template\u redirect() { { } 添加_操作('template_redirect'、'so_38101215_template_redirect') 我用我想

我想重定向Woocomece中的某个类别,因此当它被访问(单击它)时,会将用户引导到我选择的wordpress页面,而不是默认的产品页面。我的类别是:/laptop repair,我想单击它时访问该页面
:膝上型电脑修复/这是在wordpress中创建的页面。我希望您能帮助我执行以下功能:\u 38101215\u template\u redirect()
{

{

}

添加_操作('template_redirect'、'so_38101215_template_redirect')

我用我想要重定向的类别名称更改了“category”。
它的工作。

欢迎来到Stackoverflow,花几分钟的时间来参观并阅读“我该如何提出一个好问题?”。如果您愿意,您将有更好的机会得到您想要的答案。您的问题包含更多细节、信息、代码等。请记住,我们不是您旁边的人。有关无相关代码的问题,请访问Wordpress Stackexchange@。
if( function_exists( 'is_product_category' ) && is_product_category( 'category' ) )  
    $redirect_page_id = 2022; // adjust to ID of page you are redirecting to  
    wp_redirect( get_permalink( $redirect_page_id ) );  
    exit();  
}