Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

wp-login-form

Allow access to a page for admins only

<?php /* Template Name: Agency Area */ get_header(); echo ‘<div id=”body”>’; global $current_user; if( in_array( ‘administrator’, $current_user->roles ) ) { echo ‘<div class=”agency_area_menu”>’; wp_nav_menu(); echo ‘</div>’; } else { // echo ‘<p>You do not have the rights required to view this page. Sorry.</p>’; /* or with internationalization (uncomment either, adjust text domain if applicable) */ … Read more

Categories login Tags login, wp-login-form

How to trigger a login form notice message?

There’s a filter to add messages there. You can sneak in messages that will than handled like an error message (without being one). apply_filters( ‘login_message’, $message ); Here’s an example of this filter: function wpse79920_login_msg( $message ) { return ‘Hello User!’; } add_filter( ‘login_message’, ‘wpse79920_login_msg’ );

Categories wp-login-form Tags wp-login-form

Add class to input form in login form

While there is no direct filter available to modify the output of username input field. You can do this by enqueuing a js on login page and then adding a css class to username input field. Please see if below helps: add_action( ‘login_head’, ‘add_login_css’ ); function add_login_css(){ wp_register_script( ‘extra-login-css’, get_stylesheet_directory_uri() . ‘/js/extra-login-css.js’, array( ‘jquery’ ), … Read more

Categories login Tags login, wp-login-form

wp-login.php register/lost password links to buttons?

There’s no way to change the output of the file because the there aren’t any filters you can hook into. However, there are some hooks that you can use like the login_enqueue_scripts hook to enqueue jQuery and/or a custom javascript. And then login_footer to print some jQuery that will add classes that you can then … Read more

Categories wp-login-form Tags wp-login-form, wp-register-style

Redirect away from login page

The login_init hook is the first one to be called in wp-login.php, so try hooking into it instead. function redirect_invalid_login() { global $error; if( $error ) { wp_redirect( get_bloginfo( ‘url’ ) . ‘/client-login/?message=6’ ); die(); } } add_action( ‘login_init’, ‘redirect_invalid_login’ ); If that doesn’t work, please provide more details.

Categories redirect Tags redirect, wp-login-form

Change ‘Back To Website’ link in wp-login.php

You can achieve that using Javascript and login_footer action hook to change the href attribute of the Back to link: <?php add_action(‘login_footer’, ‘ad_login_footer’); function ad_login_footer() { $ref = wp_get_referer(); if ($ref) : ?> <script type=”text/javascript”> jQuery(document).ready(function($){ $(“p#backtoblog a”).attr(“href”, ‘<?php echo esc_js($ref); ?>’); }); </script> <?php endif; } ?> Edit: Thanks to @brasofilo answer, you might … Read more

Categories redirect Tags redirect, wp-login-form

How do you add a custom link to the wordpress login page?

Well, you can add link after lost your password, but I don’t think you can add link before lost your password link unless you design your own login page. function hook_lost_your_password ( $text ) { if ($text == ‘Lost your password?’){ $text .= ‘<br /><a href=”http://codebing.com”>Visit Code Bing</a>’; } return $text; } add_filter( ‘gettext’, ‘hook_lost_your_password’ … Read more

Categories wp-login-form Tags wp-login-form

Why can’t /wp-login.php be load balanced?

A few things to check on: Review wp_salt. Make sure all of the web servers are running on the same set of salts in the wp-config.php file. Ideally, these should be mirrored from a single location. Review is_ssl() and make sure this function is properly detecting SSL across all of your web servers. I’ve seen … Read more

Categories performance Tags nginx, performance, wp-login-form

How to auto login after registration? [duplicate]

Have you tried this? function auto_login_new_user( $user_id ) { wp_set_current_user($user_id); wp_set_auth_cookie($user_id); wp_redirect( home_url() ); // You can change home_url() to the specific URL,such as “wp_redirect( ‘http://www.wpcoke.com’ )”; exit(); } add_action( ‘user_register’, ‘auto_login_new_user’ ); Taken from this SO answer: WordPress auto login after registration not working

Categories redirect Tags redirect, user-registration, wp-login-form, wp-redirect

FORCE_SSL_ADMIN not working

Just figured it out… It was the positioning of the define statement. I added the below above the /* That’s all, stop editing! Happy blogging. */ line define(‘FORCE_SSL_ADMIN’, true); define(‘FORCE_SSL_LOGIN’, true); Thanks!

Categories wp-admin Tags security, ssl, wp-admin, wp-login-form
Older posts
Newer posts
← Previous Page1 … Page27 Page28 Page29 … Page35 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress