Hi
I have a problem with my “login | register” / “username | logout” link on WP theme ‘LMS’. It’s currently pointing to a generic wp-login (using the S2member plugin in some way) which doesn’t collect the registration info I need…Likewise clicking on username takes you to an account page with the wrong info…both of which also look awful. I would like both links to point to different URLs.
As it is now, the login | register link works in the following way.
If logged in, it will show ‘username’ and a ‘logout’ option
If logged out, it will show a login | register option
I would like the following to happen.
If user is logged out and they click on ‘login | register’, then should take them to http://www.asned.org/greenlight/login-4/
If user is logged in and clicks on username, then should take them to http://www.asned.org/greenlight/account-3/ OR if they logout should take them to http://www.asned.org/greenlight/
The code I need to change is below. I know nothing about php.
Would somebody be able to help?
Many thanks in advance
Mick
[php]
-
<?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;
?>
- <?php echo __('Login', 'dt_themes').' | '.__('Register', 'dt_themes'); ?> <?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 '
- '.get_avatar( $current_user->ID, 30).''.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | '.' '; elseif(!is_null($welcome)): echo '
- '.get_avatar( $current_user->ID, 30).''.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | '.' '; endif; elseif(!is_null($welcome)): echo '
- '.get_avatar( $current_user->ID, 30).''.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | '.' '; else: echo '
- '.get_avatar( $current_user->ID, 30).''.__('Welcome, ', 'dt_themes').' '.$current_user->display_name.' | '.' '; 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>
[/php]