Title: Error opening wp-admin
Last modified: August 20, 2016

---

# Error opening wp-admin

 *  [stenaols](https://wordpress.org/support/users/stenaols/)
 * (@stenaols)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/)
 * Hi. When opening wp-adming I get this error:
 * **Notice: Undefined offset: 1 in /home3/mytosno/public_html/wp-content/themes/
   mytos/classes.php on line 74**
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home3/mytosno/public_html/wp-content/themes/mytos/classes.php:74) in /home3/
   mytosno/public_html/wp-includes/pluggable.php on line 881
 * I have deactivated all plugins, but still get the error.
 * Any ideas?
 * Sten

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/#post-3157286)
 * It is in your theme– “wp-content/themes/mytos/classes.php” on line 74. It is 
   a non-fatal error so it should work with `define('WP_DEBUG',false);` as it should
   be on a live site. It should also be an easy proper fix if you want to paste 
   lines 70-80 or so of “wp-content/themes/mytos/classes.php”.
 *  Thread Starter [stenaols](https://wordpress.org/support/users/stenaols/)
 * (@stenaols)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/#post-3157305)
 * Hi. Here is lines 70 – 80:
 *     ```
       $this->user->active_blog = get_active_blog_for_user( get_current_user_id() );
       			$this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );
       			$this->user->account_domain = $this->user->domain;
       		} else {
       			$this->user->active_blog = $this->user->blogs[get_current_blog_id()];
       			$this->user->domain = trailingslashit( home_url() );
       			$this->user->account_domain = $this->user->domain;
       		}
       		$this->user->locale = get_locale();
   
       		add_action( 'wp_head', 'wp_admin_bar_header' );
       ```
   
 *  Thread Starter [stenaols](https://wordpress.org/support/users/stenaols/)
 * (@stenaols)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/#post-3157306)
 * Hi again. Changed WB_DEBUG to false, and then it worked!. Thanks a lot!
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/#post-3157311)
 * Yes, it works but it isn’t fixed.
 * The problem is here: `$this->user->active_blog = $this->user->blogs[get_current_blog_id()];`
 * That last bit of the object ‘blogs’ should be an array that looks something like
   this (illustrative only):
 *     ```
       array(
         '1' => 'aaa',
         '2' => 'bbb',
         '3' => 'ccc
       )
       ```
   
 * If `get_current_blog_id()` is 1, 2, or 3 everything is fine. If it is 0, or greater
   than 3 you get that error. You are trying to access an array key that doesn’t
   exist. That is what ‘undefined offset’ means in this context. The code should
   check for the existence of that array key before trying to use it, as is done
   on the second line of the code you posted.

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

The topic ‘Error opening wp-admin’ is closed to new replies.

## Tags

 * [wp-admin](https://wordpress.org/support/topic-tag/wp-admin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/error-opening-wp-admin/#post-3157311)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
