开发者

How to change default wordpress logout template?

开发者 https://www.devze.com 2023-03-31 12:58 出处:网络
I am new to wordpress development and now I am stuck. I need to change style and add some buttons in default w开发者_如何学Cordpress logout template (when i am redirected to http://example.com/wp-logi

I am new to wordpress development and now I am stuck. I need to change style and add some buttons in default w开发者_如何学Cordpress logout template (when i am redirected to http://example.com/wp-login.php?action=logout ).

But the question is where i can find that template?

Thanks in advance.

Regards.

Ivelin Georgiev


Right...

There (unfortunately) isn't a template page for the login page. I'm not sure why this is, maybe its for security or something, I dunno. In any case you can't edit it directly without messing with the wordpress core.

However there are various hooks and actions you can add to in order to do some customisations. Here is some sample code from my own applications:

  // 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';"));

Stick that into your functions.php file in your theme to get it to work.

There will be other such methods and hooks you can change and add to, you just need to find them.


Use Themed login plugin - It allows to make login and registration process themeable using site's theme.

0

精彩评论

暂无评论...
验证码 换一张
取 消