WordPress.org

Ready to get started?Download WordPress

Forums

Question on functions.php and Admin Dashboard. (3 posts)

  1. fatalx
    Member
    Posted 2 years ago #

    So I have a ton of code in my functions.php and a very large majority of it is for admin logged into wp-admin. Is there a way to make it so parts of my code will only run for admins logged into wp-admin?

    Although a normal user won't see anything happening in the functions.php file. There is no need to a lot of that code to run for them at all.

    Thanks in advance.

  2. govpatel
    Member
    Posted 2 years ago #

    Warning! If you make any change to theme functions.php file it will break your website do not do any change unless you know what you doing.

  3. MickeyRoush
    Member
    Posted 2 years ago #

    Is there a way to make it so parts of my code will only run for admins logged into wp-admin?

    It would be better to try a plugin. I've used one of these before in the past.

    http://wordpress.org/extend/plugins/st-admin-protection/
    http://wordpress.org/extend/plugins/wp-block-admin/
    http://wordpress.org/extend/plugins/remove-dashboard-access-for-non-admins/
    http://wordpress.org/extend/plugins/wp-hide-dashboard/

    But be warned, these could cause problems with plugins and other functionalities of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic