Title: function can&#039;t get loaded
Last modified: August 24, 2016

---

# function can't get loaded

 *  [Sub_Zero](https://wordpress.org/support/users/sub_zero/)
 * (@sub_zero)
 * [11 years ago](https://wordpress.org/support/topic/function-cant-get-loaded/)
 * Hi,
 * When I try this code, the function won’t get loaded. At least I don’t get the
   echo message. How comes?
 *     ```
       function custom_login() {
       	$creds = array( 'user_login' =>  $_POST['benutzername'], 'user_password' => $_POST['passwort'], 'remember' => true );
       	$user = wp_signon( $creds, false );
       	if ( is_wp_error($user) ): echo $user->get_error_message(); endif;
       	wp_set_current_user($user->ID);
       	echo '<h1>HELLO</h1>';
       }
       add_action( 'after_setup_theme', 'custom_login' );
       ```
   

Viewing 1 replies (of 1 total)

 *  [Martin Robbins](https://wordpress.org/support/users/santeven/)
 * (@santeven)
 * [11 years ago](https://wordpress.org/support/topic/function-cant-get-loaded/#post-6088805)
 * I think the after_setup_theme is happening well before any browser output occurs,
   so you won’t see the output echo.
 * For a try just to confirm your code is run, try get_footer instead …
 * Also see the [plugin API action reference](http://codex.wordpress.org/Plugin_API/Action_Reference)

Viewing 1 replies (of 1 total)

The topic ‘function can't get loaded’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Martin Robbins](https://wordpress.org/support/users/santeven/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/function-cant-get-loaded/#post-6088805)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
