admin管理员组

文章数量:1334327

I have no idea what function to use to add this line to the wp-login.php header:

<meta name="viewport" content="width=device-width, user-scalable=no">

I have tried add_action('wp_head', 'change_this_name_of_your_function'); until I have found out that the wp-login.php file uses a different header. Thanks for your help!

I have no idea what function to use to add this line to the wp-login.php header:

<meta name="viewport" content="width=device-width, user-scalable=no">

I have tried add_action('wp_head', 'change_this_name_of_your_function'); until I have found out that the wp-login.php file uses a different header. Thanks for your help!

Share Improve this question asked Jun 7, 2020 at 17:59 Robin AlexanderRobin Alexander 1538 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

wp_head is for adding stuff in the head of the public/non-admin side of a WordPress site. For the standard login page for the admin screens, you can use login_head:

add_action( 'login_head', function () {
    echo '<meta name="viewport" content="width=device-width, user-scalable=no">';
} );

本文标签: How to add some lines to the wploginphp header via functionsphp