找到主题下functions.php文件中新增以下代码
//禁止WordPress所有页面的跳转功能 function disable_page_redirects() { global $wp_query; if ( is_singular() ) { $wp_query->set_404(); status_header( 404 ); } } add_action( 'init', 'disable_page_redirects' ); //禁止“your-url”特定页面的跳转链接。 function custom_disable_redirect_canonical( $redirect_url ) { if ( is_page( 'your-page-slug' ) ) { return false; } return $redirect_url; } add_filter( 'redirect_canonical', 'custom_disable_redirect_canonical' );
标签: wordpress代码, wordpress优化
上面是“wordpress想让某个链接不进行跳转代码示例”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_15228.html
workflows工作流
3D圆形玉雕图案comfyui工作流
一只竹节虫ComfyUI工作流
1个粉红色头发可爱的女孩ComfyUI工作流
庭院,彩色玫瑰,云雾笼罩comfyui工作流
一只蚂蚁在花丛中找食物ComfyUI工作流
一只迷人的黑豹ComfyUI工作流
一条色彩斑斓的超现实小孔雀鱼ComfyUI工作流
ai图片扩大comfyui工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!