对现有网站管理面板使用 WordPress admin
嗨,大家好 我被要求向网站添加一个 WordPress 博客,我想知道是否有办法让现有的网站管理区域使用与 WordPress 管理员相同的登录名!
PS:我知道我可以制作一个 WordPress 插件来从 wp-admin 内部控制现有网站,但我不想这样做。 那么有没有办法在现有管理面板的标题中包含一些 WordPress 页面或功能?
[编辑]因为该网站阻止我回答问题: 你的回答让我进行了一些头脑风暴,瞧! 我读了这篇文章: http: //www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts 然后使用插件: http://wordpress.org/extend/plugins/root-cookie/ 通过它,我可以移动 cookies 的位置,并将以下代码添加到现有的 CMS 标头中:
<?php
define('WP_USE_THEMES', false);
require('../portal/wp-load.php');
require_once('../portal/wp-config.php');
if (!is_user_logged_in()){auth_redirect();}?>
我希望我的解决方案有用!
Hi guys
I was asked to add a wordpress blog to a website, I was wondering if there was a way to let the existing website admin area use the same login as wordpress admin!
P.S: I know that I can make a wordpress plugin to control the existing website from inside wp-admin, but I don't want to do this.
So is there a way to include some wordpress page or function in the header of the existing admin panel?
[edit] as the website prevented me from answering the question:
Your answers gave me some brain storming and Voila!
I read this article: http://www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts
and then used the plugin: http://wordpress.org/extend/plugins/root-cookie/
Through it I could move the cookies place, and added the following piece of code to the existing CMS header:
<?php
define('WP_USE_THEMES', false);
require('../portal/wp-load.php');
require_once('../portal/wp-config.php');
if (!is_user_logged_in()){auth_redirect();}?>
I wish my solution will be useful!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不是 wordpress 的用户,我不知道确切的变量,但我猜 WP 设置了一个会话变量,以便它知道您已登录。我不明白为什么您不能在自己的变量中设置该变量脚本。
当然,事情并不总是那么简单,但这就是我要开始寻找的地方。
[编辑]看到您的评论回复,本质上是同一件事,但倒退了。找到在您的旧 CMS 和 eidt wordpress 中设置的会话,以便在您登录时也对其进行设置。
Not being a user of wordpress I don't know the exact variables, but I would guess WP sets a session variable so that it knows you are logged in. I can't see why you couldn't just set that variable in your own script.
Of course it is not always that simple, but that's where I would start looking.
[EDIT] seeing your comment response, it is essentially the same thing, but backwards. Find the session that is set in your old CMS and eidt wordpress so that it gets set as well when you log in.
将您的 WordPress 会话存储在数据库或 Cookie 中。然后在旧的 CMS 中编写一个脚本来检查该存储。
Store your wordpress session in a database or a cookie. Then write a script in your old CMS that checks that storage.
你的回答让我进行了一些头脑风暴,瞧!我读了这篇文章: http: //www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts 然后使用插件:http://wordpress.org/extend/plugins/root-cookie/ 通过它我可以移动 cookies 的位置,并将以下代码添加到现有的 CMS 标头中:
我希望我的解决方案有用!
Your answers gave me some brain storming and Voila! I read this article: http://www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts and then used the plugin: http://wordpress.org/extend/plugins/root-cookie/ Through it I could move the cookies place, and added the following piece of code to the existing CMS header:
I wish my solution will be useful!