Mobile/Desktop Login

Posted in: Newspaper
Post count: 59

Hello,
I want help, so i will have a website, which will be the same for desktop and mobile view, so it will be identical.
Now, it is not, there are differences between mobile view and desktop view( i am not using mobile theme plugin )
The difference, that i was not able to solve myself is the login/register

In Desktop view: “Sign in/Join” there is one button, however in mobile view, it is separate, First is Sign in and the Second is Join button.
So What i am trying to make is to edit Desktop view and put there Sign in button and join button separately.

So, I need to find mobile login code and implement it into desktop.

So I need to find and put it somehow here: Newspaper>Parts>Header>Top-menu.php
Look at the screen> I need to edit that code

So in Desktop view I will have different button for Sign In and and different for Join.

I do hope you will help me, it is the last bit that’s left, before publishing my website.

Thanks in advance.

Post count: 59

The website is https://siteww.com/

Post count: 20688

Hi,

That link is defined in that file you mention, so you could begin there. The modal window that opens once the login is clicked is in this file
https://www.screencast.com/t/4vulJXMHD
On mobile different files are used, there will be a sign in and a different join button
https://www.screencast.com/t/oIeMx5p5p
Maybe this is useful to you if you want to make this modification to the desktop login.

Thanks

Post count: 59

Hello and Huge thanks for your reply.

I think I did not explain it well.
I do not want to change what is after you click the button.
I just want to make desktop login as it is for mobile, So I want to have 2 buttons for desktop login, first button will be sign in and the second button will be for Registration.

So, I have here Desktop login code:
From Newspaper>Parts>Header>Top-menu.php <<< from here
————————-
//show login widget
if (td_util::get_option(‘tds_login_sign_in_widget’) == ‘show’) {
//test if user is logd in or not
if ( is_user_logged_in() ) {
//get current logd in user data
global $current_user;

//<span class=”td-sp-ico-logout”></span>
echo ‘<ul class=”top-header-menu td_ul_logout”>
<li class=”menu-item”>’ .
get_avatar($current_user->ID, 20) . ‘ID) . ‘” class=”td_user_logd_in”>’ . $current_user->display_name . ‘‘ .

<li class=”menu-item”>
<i class=”td-icon-logout”></i>’ . __td(‘Logout’, TD_THEME_NAME) . ‘

‘;
} else {

echo ‘<ul class=”top-header-menu td_ul_login”><li class=”menu-item”>‘ . __td(‘Sign in / Join’, TD_THEME_NAME) . ‘<span class=”td-sp-ico-login td_sp_login_ico_style”></span>‘;
}
}//end login window
———————————

This is the Code. So i want to edit that code, so i will have 2 buttons for desktop as it is for mobile.
Mobile login code is here:
Newspaper>Parts>Login.php
This is the code:
————————————–
<?php
//get current logd in user data
global $current_user;
//check if admin allow registration
$users_can_register = get_option(‘users_can_register’);

//if admin permits registration
$users_can_register_tab = ”;

if ($users_can_register == 1) {
//add the Register tab to the modal window if Anyone can register chec
$users_can_register_tab = ‘ <span></span>‘ . __td(‘Join’, TD_THEME_NAME) . ‘‘;
}

echo ‘
<div class=”td-guest-wrap”>
<div class=”td-menu-avatar”><div class=”td-avatar-container”>’ . get_avatar($current_user->ID, 80) . ‘</div></div>
<div class=”td-menu-login”>‘ . __td(‘Sign in’, TD_THEME_NAME) . ‘‘ . $users_can_register_tab . ‘</div>
</div>
‘;

————————

If i just copy this code( second code, mobile login code) and paste instead of the first code, desktop login code, the theme does not work. So just copy/paste does not work. That’s where i want your help, to implement/edit mobile login code, so when i put into Newspaper>Parts>Header>Top-menu.php << here (this is where desktop login code is) will work, and i will have 2 buttons for both mobile and desktop view.

I hope, you will understand and sorry for bothering that much. Thank you.

Post count: 20688

Hi,

From what I understood you want to split the Sign in/Join button in 2 buttons. The button is located in the file you mentioned, try duplicating it
https://www.screencast.com/t/NWYCm3L1O8BV
Then modify them somehow to split their function in 2 parts, the sign in should open the sign in modal, while the join button the create an account modal. It may not be easy. You will have to modify the code accordingly and keep testing.

Or you could simply disable the theme login and use a login plugin or different implementation.

Thanks

Post count: 59

Okay, Thanks, i will try duplicating

Post count: 59

I have duplicated it, however i could not find the address(href), which registration popup opens.
————

————
In this code i should put the href=”REGISTER WINDOWS ADDRESS” – which i don’t know. Sign in windows address is “#login-form”

Post count: 20688

The register div and the register link would be here
https://www.screencast.com/t/aLUXcRycXR
Note that this may not work at all or fully, this is not the intended behavior of the theme login function. You could as I mentioned use a custom login and disable the theme login. That would be easier.
Unfortunately we do not have a theme customization or modification department to provide more advanced assistance with code modifications.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.