Title: Error Entering Code
Last modified: March 21, 2017

---

# Error Entering Code

 *  Resolved [Shaun Williams](https://wordpress.org/support/users/eangulus/)
 * (@eangulus)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/)
 * Hi,
 * When I try to add this code:
 *     ```
       // Custom Login Branding
       // Adding the function to the login page
       add_action('login_head', 'custom_login');
   
       // Our custom function that includes the custom stylesheet
       function custom_login() {
       	echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'stylesheet_directory' ) . '/login.css" />';
       }
   
       function my_login_logo_url() {
       	return get_bloginfo( 'url' );
       }
       add_filter( 'login_headerurl', 'my_login_logo_url' );
   
       function my_login_logo_url_title() {
       	return get_bloginfo( 'title' );
       }
       add_filter( 'login_headertitle', 'my_login_logo_url_title' );
       ```
   
 * I get a 403 error. In particular if I leave out this line:
 * `echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'stylesheet_directory').'/
   login.css" />';` it saves fine but I put that line back in and I get the 403 
   error code again.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Shaun Williams](https://wordpress.org/support/users/eangulus/)
 * (@eangulus)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/#post-8937689)
 * Just an update. I am currently trying to move all my functions.php code (that
   is not theme specific), to code snippets, and I am getting the same error as 
   above for anything that has a line like this:
 * `echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'stylesheet_directory').'/
   notice.css" />';`
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/#post-8950627)
 * This does not answer the question of why the error is occurring, but you should
   be using `wp_enqueue_script` instead of echoing HTML. So you could alter your`
   custom_login()` function to look like this:
 *     ```
       function custom_login() {
       	wp_enqueue_script( 'theme-login', get_bloginfo( 'stylesheet_directory' ) . '/login.css' );
       }
       ```
   
 * This should allow the snippet to save properly, but I am still unsure as to what
   is causing the error. Unfortunately, I’ve never been able to reproduce this error,
   and without access to a site where it exists, I have not been able to find a 
   solution.
 *  Thread Starter [Shaun Williams](https://wordpress.org/support/users/eangulus/)
 * (@eangulus)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/#post-8950894)
 * You simply just have to ask if you want access.
 * Let me know where I can send details to.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/#post-8957647)
 * It’s really up to you – but I suppose it would help debug this problem. You can
   send me an email at shea [at] bungeshea [dot] com

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error Entering Code’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/error-entering-code/#post-8957647)
 * Status: resolved