Web Design
Mobile Internet
Brand Design
Innovative
News
Encyclopedias

How does WordPress replace the default home page after login

Date:2013-04-07 Source: Shangpin China Type: website encyclopedia
Word Size: small   medium   big

Beijing website construction Company Shangpin China: The "dashboard" page that is displayed by default after WordPress logs in, that is, the "dashboard" page previously mentioned, in fact, this "dashboard" page is really of little practical significance. Now I want to directly display the "all articles" page (or any page in the background) after logging in. What should I do? The following content can also be regarded as answering the questions of netizens.

In fact, the operation is also very simple. Use a text editor to open functions.php under the current theme directory, and add the following php code at the end:

function my_login_redirect(redirect_to,$request)

if(empty(redirect_to )|| $redirect_to == 'wp-admin/' || $redirect_to == admin_url())

return home_url("/wp-admin/edit.php");

else

return $redirect_to;

}

add_filter("login_redirect", "my_login_redirect", 10, 3);

In line 10,/wp admin/edit.php is the address of the background page to jump to after login. It is set as all article pages. If you want to jump to the article writing page after login, you can change it to/wp admin/post new. php, and so on.

Note: If your WordPress is installed in a subdirectory, such as the wp directory, then the address in line 10 should be added with a subdirectory, such as/wp/wp admin/edit.php

This article was published on Beijing website production Company Shangpin China //ihucc.com/


Please contact our consultant

+86 10-60259772

Please provide your contact number. The project manager of shangpin China will contact you as soon as possible.