Fuction php problem
-
Hi there,
I recently go some code from the word press forumn to stop non admin users accessing my wordpress dashboard when using buddy press. Here is the code below
This is the page I got the code from
Add this code snippet to your child themes functions.php and it will do what you need.
<?php //Removes Access To Dashboard By Non-Admins Per Shawn
function baw_no_admin_access()
{
if( !current_user_can( ‘administrator’ ) ) {
wp_redirect( home_url() );
die();
}
}
add_action( ‘admin_init’, ‘baw_no_admin_access’, 1 );
?>Right away I got this error below
Parse error: syntax error, unexpected ‘<‘ in /home/thonwa/buzztwitter.com/wp-content/themes/sweetdate-child/functions.php on line 14
I removed the code, but still got the error and was locked out of my site.
I have been in touch with dream host 3 times now and had them
upload another theme, but the same thing happens. I had them delete the child theme (sorry to make you aware all of this was carried out in th child theme). They deleted the child theme, I uploaded a new version and the same thing has happened.I am totally stumped and any help would be greatly appreciated, will be sitting here biting my nails in anticiapation, really loving wordpress at the moment and cannot wait to dive right back in after this minor setback, it’s all a learning curve :-)
The blog I need help with is: (visible only to logged in users)
-
-
Sorry but you are in the wrong forum.
This forum is only for blogs/sites hosted by WordPress.comWordPress.COM and WordPress.ORG are completely separate and different http://support.wordpress.com/com-vs-org/
And you should ask in the WordPress.org forum.
http://wordpress.org/support/ -
Ok Galios …. But just in case anyone comes across this thread, I went to my host DreamHost, (who are out of this world by the way). I had them delete my main theme and my child theme and then just reloaded them through the WordPress dashboard, Hey WordPresto Job Done, life is good again. Good luck guys, keep learning :-)
- The topic ‘Fuction php problem’ is closed to new replies.