Skip to content

Instantly share code, notes, and snippets.

View jasonb4u's full-sized avatar

Jaso jasonb4u

View GitHub Profile
@jasonb4u
jasonb4u / custom-wordpress-login-image.txt
Last active April 20, 2022 09:13
WordPress Custom Login Page LOGO
/*Add the following code to yr themes child functions.php file or into Code Snippets plugin. remember to change the url*/
function login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url(https://mywebsite.com/wp-content/uploads/2021/10/my_image.png); /* this is the FULL path to your image*/
height:175px; /*You will have to test and play to make sure these measurements work with your image size*/
width:175px;
background-size: 175px 175px;
background-repeat: no-repeat;
@jasonb4u
jasonb4u / Hide Admin Administrator User from User Role list
Last active November 11, 2021 07:24
Hide Admin Administrator User from User Role list
/****** Add these to Codes Snippets or in Child Theme functions.php file */
/****** This Removes Administrator role from roles list except logged in Admin, cannot ADD or edit any ADNINISTRATOR */
add_action( 'editable_roles' , 'hide_adminstrator_editable_roles' );
function hide_adminstrator_editable_roles( $roles ){
if ( isset( $roles['administrator'] ) && !current_user_can('level_10') ){
unset( $roles['administrator'] );
}
return $roles;
}