• Resolved rakesh1974

    (@rakesh1974)


    The logout option is ridiculously placed that appears on acadp login page…

    I tried using the default wp login/logout function code as below but that does not give the styling of [acadp_login] page it redirects to the default wp-login page…

    How can we have a similar option for this particular function for acadp to use [acadp_login] page including a logout link?

    // Does not work for custom login page 
    // Add default WP login logout link in the header menu
    add_filter('wp_nav_menu_items', 'crunchify_add_login_logout_menu', 10, 2);
    function kadence_add_login_logout_menu($items, $args) {
            ob_start();
            wp_loginout('index.php');
            $loginoutlink = ob_get_contents();
            ob_end_clean();
            $items .= '<li style="float: right;">'. $loginoutlink .'</li>';
        return $items;
    }
    • This topic was modified 1 year, 9 months ago by rakesh1974.
Viewing 1 replies (of 1 total)
  • Plugin Author pluginsware

    (@pluginsware)

    Dear Customer,
    Kindly try using the following code,

    add_filter( 'wp_nav_menu_items', 'acadp_custom_add_login_logout_menu', 10, 2 );
    function acadp_custom_add_login_logout_menu( $items, $args ) {
    ? ? if ( ! is_user_logged_in() ) {
    ? ? ? ? $items .= '<li style="float: right;"><a href="' . esc_url( acadp_get_user_login_page_link() ) . '">' . __( 'Log in' ) . '</a></li>';
    ? ? } else {
    ? ? ? ? $items .= '<li style="float: right;"><a href="' . esc_url( wp_logout_url( acadp_get_user_login_page_link() ) ) . '">' . __( 'Log out' ) . '</a></li>';
    ? ? }
    
    ? ? return $items;
    }

    Hope this solved your issue!
    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Login/Logout Option’ is closed to new replies.