cleartango
IS-IT--Management
Hi
I have a problem with my "login | register" / "username | logout" link on WP theme ‘LMS'. I need to change the URLs where they are pointing
As it is now, the login | register link works in the following way.
If logged out, it will show a login | register option. Clicking on it takes you to wp-login (using the S2member plugin in some way) which doesn’t collect the registration info I need
If logged in, it will show ‘username' and a ‘logout’ option. Clicking on the username takes you to an S2member account page which looks awful and doesn’t show the info I need to show.
I would like both links to point to different URLs.
If user is logged out and they click on 'login | register', then should take them to If user is logged in and clicks on username, then should take them to OR if they logout should take them to
The code I need to change is below. I know very little about php, but am keen to learn.
Would somebody be able to help and show me what I need to change?
Many thanks in advance
Mick
I have a problem with my "login | register" / "username | logout" link on WP theme ‘LMS'. I need to change the URLs where they are pointing
As it is now, the login | register link works in the following way.
If logged out, it will show a login | register option. Clicking on it takes you to wp-login (using the S2member plugin in some way) which doesn’t collect the registration info I need
If logged in, it will show ‘username' and a ‘logout’ option. Clicking on the username takes you to an S2member account page which looks awful and doesn’t show the info I need to show.
I would like both links to point to different URLs.
If user is logged out and they click on 'login | register', then should take them to If user is logged in and clicks on username, then should take them to OR if they logout should take them to
The code I need to change is below. I know very little about php, but am keen to learn.
Would somebody be able to help and show me what I need to change?
Many thanks in advance
Mick
PHP:
<div class="header-register">
<ul>
<?php
if(!is_user_logged_in()):
$login = dttheme_get_page_permalink_by_its_template('tpl-login.php');
$login = is_null($login) ? home_url()."/wp-login.php" : $login;
?>
<li><a href="<?php echo $login; ?>" title="<?php _e('Login / Register Now', 'dt_themes');?>"><i class="fa fa-user"></i><?php echo __('Login', 'dt_themes').'<span> | </span>'.__('Register', 'dt_themes'); ?></a></li>
<?php
else:
$current_user = wp_get_current_user();
$welcome = dttheme_get_page_permalink_by_its_template('tpl-welcome.php');
if( dttheme_is_plugin_active('s2member/s2member.php') ):
$login_welcome_page = get_option('ws_plugin__s2member_cache');
$login_welcome_page = $login_welcome_page['login_welcome_page'];
$page = $login_welcome_page['page'];
if( !empty($page) ):
$link = $login_welcome_page['link'];
$title = get_the_title($page);
echo '<li><a href="'.$link.'">'.get_avatar( $current_user->ID, 30).'<span>'.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | </span>'.'</a></li>';
elseif(!is_null($welcome)):
echo '<li><a href="'.$welcome.'">'.get_avatar( $current_user->ID, 30).'<span>'.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | </span>'.'</a></li>';
endif;
elseif(!is_null($welcome)):
echo '<li><a href="'.$welcome.'">'.get_avatar( $current_user->ID, 30).'<span>'.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | </span>'.'</a></li>';
else:
echo '<li><a href="#">'.get_avatar( $current_user->ID, 30).'<span>'.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | </span>'.'</a></li>';
endif;
echo '<li><a href="'.wp_logout_url(get_permalink()).'" title="'.__('Logout', 'dt_themes').'">'.__('Logout', 'dt_themes').'</a></li>';
endif;
if(class_exists('WooCommerce') && dttheme_option('appearance', 'enable-header-cart')) {
global $woocommerce;
$cart_url = $woocommerce->cart->get_cart_url();
echo '<li class="dt-sc-cart"><a href="'.$cart_url.'"><i class="fa fa-shopping-cart"></i></a></li>';
}
?>
</ul>
</div>