functions.php in theme causes error in wp-admin
-
Hi there,
I’ve added a functions.php to my theme with a simple function for displaying authors.
<?php // display all users with a link to their user page function show_authors() { global $wpdb; $users = $wpdb->get_col("SELECT * FROM $wpdb->users ORDER BY user_nicename"); foreach($users as $user) { $user = get_userdata($user); echo '<li><a href="' . get_author_posts_url($user->ID, $user->user_nicename) . '">' . $user->display_name . '</a></li>'; } } ?>works fine, however when i went back to login onto my wp-admin interface i got this error
Warning: Cannot modify header information - headers already sent by (output started at /home/herozero/html/2/wp-content/themes/HZV02IS01/functions.php:1) in /home/herozero/html/2/wp-includes/pluggable.php on line 694How can i solve this? And why is wp doing this? It’s not like you need the theme when accessing your admin right?
Help!Thanks in advance…
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘functions.php in theme causes error in wp-admin’ is closed to new replies.