在WordPress上登录后重定向

编程入门 行业动态 更新时间:2024-10-21 15:28:05
本文介绍了在WordPress上登录后重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在基于现有网站创建自定义WordPress主题.

I'm creating a customized WordPress theme based on an existing site.

我想使用我创建的备用仪表板.

I want to use an alternate dashboard which I have created.

如何在登录后将用户定向到"news.php"而不是"/wp-admin/"?

How can I have the user directed to 'news.php' after login instead of '/wp-admin/' ?

-

对此有一个有效的插件,但是赏金仍然可用于任何可以通过functions.php手动找到实现此目的的人,因为与使用第3方插件相比,它会更安全-in.

推荐答案

这应该可以解决您的问题.

This should solve your problem. Adapted from an answer found here.

在主题的functions.php文件中添加以下代码片段:

Add the following snippet of code in the functions.php file of your theme:

function admin_default_page() { return '/new-dashboard-url'; } add_filter('login_redirect', 'admin_default_page');

更多推荐

在WordPress上登录后重定向

本文发布于:2023-10-31 16:19:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   WordPress

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!