Asked  2 Years ago    Answers:  5   Viewed   91 times

I have a website, with a user system. I want to integrate wordpress's user system into that website's, but I still want to use the website's register/login pages. I don't want anybody to be able to login or register using Wordpress's login or registration forms. Instead, when they're try to access the login/registration pages in Wordpress, I want those pages to redirect them to my own login/registration pages.

Is there any way of doing this? I've tried Google, but all I could find was redirection AFTER the user logs in or registers, which is not what I want.

Thank you in advance.

 Answers

5

For this you need to redirect login/registration page to your custom pages. So, Write this code in your functions.php file Under your activated theme folder. Pass your custom page path as a Argument.

 add_action('init','possibly_redirect');

function possibly_redirect(){
 global $pagenow;
 if( 'wp-login.php' == $pagenow ) {
  wp_redirect('http://google.com/');
  exit();
 }
}
Saturday, August 13, 2022
1

This should solve your problem. Adapted from an answer found here.

Add the following snippet of code in the functions.php file of your theme:

function admin_default_page() {
  return '/new-dashboard-url';
}

add_filter('login_redirect', 'admin_default_page');
Saturday, August 13, 2022
2

Im not sure didnt test but you can use user roles with if else statement

function redirect_after_logout() {
    if (!current_user_can('manage_options')) { 
        $url = '/';
    } else { 
        $url = 'member-login?logged_out=true';
    }
    $redirect_url = home_url( $url );
    wp_safe_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', array( $this, 'redirect_after_logout' ) );
Monday, August 8, 2022
 
4

From the apache documentation,

URLs can begin with a slash (/) for local web-paths (relative to the 
DocumentRoot), or be a full URL which the client can resolve.

I guess ErrorDocument 503 /maintenance.html should work.

Monday, September 26, 2022
3

Per the Action Bar training, you have to use the app:showAsAction attributes rather than the android:showAsAction attribute:

Notice that the showAsAction attribute above uses a custom namespace defined in the <menu> tag. This is necessary when using any XML attributes defined by the support library, because these attributes do not exist in the Android framework on older devices. So you must use your own namespace as a prefix for all attributes defined by the support library.

So your menu file should look like:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto" >
    <item
        android:id="@+id/action_test"
        app:showAsAction="always"
        android:icon="@drawable/ic_launcher"
        android:title="@string/action_settings"/>

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        app:showAsAction="never"
        android:title="@string/action_settings"/>
</menu>
Monday, November 14, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 

Browse Other Code Languages