Add text to user login page
You can do this very simple way using hook_form_FORM_ID_alter.

Paste following code in your themename.theme file and clear the cache

function YourThemeName_form_user_login_form_alter(&amp;$form, FormStateInterface $form_state) {
    $form['newline'] = array(
      '#type' =&gt; 'markup',
      '#markup' =&gt; t('&lt;h2&gt;Enter your login information here!&lt;/h2&gt;'),
      '#weight' =&gt; -10,
    );
}


Image output:

Before:


  


After:


  


This way you do not need to worry about anything, it will only show in Login page.