下面的代码将访问者重定向到您想要的任何页面。
// Redirect to thank you post after comment
add_action(\'comment_post_redirect\', \'redirect_to_thank_page\');
function redirect_to_thank_page() {
return \'https://example.com/thank-you\';
}
但是,我使用WP Multisite功能,网络中的所有子网站都使用相同的活动主题。那么,我可以根据访问者访问的子网站重定向访问者吗?i、 e.如果您对示例发表评论。com/fr,然后您将自动重定向到示例。com/fr/thank-you页。
如果我们在上面的代码片段中使用blog id或子目录名,可能会有所帮助?
WP Multisite method: 子目录
当做