我是wordpress开发的新手,现在我被困住了。我需要改变样式,并在默认的wordpress注销模板中添加一些按钮(当我被重定向到http://example.com/wp-login.php?action=logout时)。
,但问题是我在哪里可以找到那个模板?
提前谢谢。
致以问候。
伊夫林·乔治耶夫
发布于 2011-08-30 10:24:22
对的..。
(不幸的是)没有用于登录页面的模板页面。我不知道这是为什么,也许是为了安全什么的,我不知道。在任何情况下,您都不能直接编辑它而不干扰wordpress核心。
但是,为了进行一些定制,您可以添加各种钩子和操作。下面是我自己的应用程序中的一些示例代码:
// this adds stuff to the head. You can add a stylesheet
// if you want, or just css like I have.
add_action("login_head", "cust_login_head");
function cust_login_head()
{
// this just changes the logo
?>
<style>
body.login #login h1 a {
background: url('<?=plugins_url('images/logomed.png',__FILE__)?>') no-repeat scroll center top transparent;
height: 64px;
width: 307px;
margin-left: 10px;
}
</style>
<?php
}
// these change the default links from wordpress to whatever you want
add_filter('login_headertitle', create_function(false, "return 'http://website.com';"));
add_filter('login_headerurl', create_function(false, "return 'http://website.com';"));将其放入主题中的functions.php文件中,以使其正常工作。
还有其他这样的方法和钩子,您可以更改和添加,您只需要找到它们。
发布于 2011-08-30 20:26:05
使用主题登录插件-它允许使用网站的主题使登录和注册过程成为主题。
https://stackoverflow.com/questions/7241724
复制相似问题