0

I'm trying to change the default Wordpress login/signup page by doing this:

Adding this code anywhere in function.php file of my theme:

function custom_login_css() {
echo '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/login/login-styles.css" />';
}
add_action('login_head', 'custom_login_css');

Creating a /login directory in my theme's folder and put login-styles.css in it and save it.

 .login form {
  margin-left:auto;
  margin-right:auto;
  padding:30px;
  border: 1px solid rgba(0,0,0,.2);
  background-clip: padding-box;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
  overflow: hidden;
  }

When I try to load http://www.mscaspian.com/store/wp-login.php I get:

<link rel="stylesheet" type="text/css" href="http://www.mscaspian.com/store/wp- content/themes/blaszok/login/login-styles.css" />

above the page instead of applying to the page.

  • Please clean up your code and add it in a code block. Also don't use the wordpress.org tag – Pieter Goosen Jul 21 '14 at 13:16
  • some of it didn't fit but i'll try again. what tags do you suggest? i couldn't find any relevant tags. – Conspiria Jul 21 '14 at 13:19
0

The &lt; at the start and the &gt; at the end cause the problem when echoing in your custom_login_css function. Replace them with < >.

The &lt; and &gt; are HTML entities meaning that if you want to print to your page a HTML reserved character you have to use this entities so the browser will understand that you don't want to use the HTML characters as code but to display it.

More about HTML entities : https://en.wikipedia.org/wiki/HTML_entity

  • yes it worked. i didn't know what those characters are used for until now. Great answer. thank you!! – Conspiria Jul 21 '14 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.