WordPress Replace change landing page logo and link

Source: Internet
Author: User

Recently many new people asked how to change the WordPress site background login screen logo and logo image link address. Actually, I don't think it's necessary. How many people do you expect to register and log on to your little website? Let's get to the content. Do not grumble, the following small V to teach you how to change the wordpress backstage logo and link.

Method One: Directly modify the system file wp-login.php or directly replace the system logo.

In the root directory of your website wp-admin/ Images folder found Logo-login.png file, with this image overlay replaced with their own prepared logo-login.png picture, so the login page logo is replaced, next is to modify the logo image link URL.

Open wp-login.php Find

$login _header_url= __ (' http://wordpress.org/');

Replace the URL with the one you need.

(PS: This method is the quickest, but small V is not recommended, because wp-ogin.php is a system file, when each WordPress upgrade will be overwritten by the restore.) )

Method Two: Use the WordPress function to replace the background landing page logo and link.

Open the functions.php file in the topic you are currently using and add the following code:

Functioncustom_loginlogo () {

Echo ' <style type= "text/css" > H1 a {background-image:url ('. Get_bloginfo (' template_directory '). ' /images/logo_login.png)!important; } </style> ';

}

Add_action (' Login_head ', ' Custom_loginlogo ');

Then create a new images in the theme directory and name the image you want to replace the logo with Logo_login.png in the Images folder. The next step is to change the URL that the logo image links to.

Open the functions.php file in the topic you are currently using and add the following code:

Functioncustom_loginlogo_url ($url) {

Return ' http://v7v3.com '; Enter the URL address you want to link to here

}

Add_filter (' Login_headerurl ', ' custom_loginlogo_url ');

Of course you have to load the custom landing page style can also, add the following code in the functions.php file:

Functioncustom_login () {echo '

<link href= "'. Get_bloginfo (' Template_directory '). '/login.css ' rel= "stylesheet" type= "Text/css"/> "; }

Add_action (' Login_head ', ' custom_login ');

Custom landing page style files are login.css in the theme directory.

WordPress Replace change landing page logo and link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.