latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Taking out default wp-login/logout page

Home Forums Community Forum Taking out default wp-login/logout page

This topic contains 4 replies, has 2 voices. Last updated by  Raam Dev 4 years, 7 months ago.

Topic Author Topic
Posted: Friday Jun 8th, 2012 at 5:02 am #15915

I have 3 questions.

1. I would like to either remove the adminbar (top of my screen) for subscribers or have the log out point to a specific page after it logs out. Without going to the default wp-login. Is that possible?

2. In my template there is a login/register and signout link. Changing depending on whether you are logged in or not. I am not much of a PHP coder but I would like to adjust it so it points, like question 1, to a specific page where it has the signup and login. I managed to do the register part, but I need help with the rest.

This is the code that I found in the header:

<?php if(is_user_logged_in()) { ?>
					<?php wp_loginout(); ?> <?php _e('of your account', 'theme1392');?>
                <?php } else { ?>
                    <b><?php _e(' You have not yet registered to our club?', 'theme1392');?></b> <a href="<?php bloginfo('url'); ?>/join-the-battlefield-knights/"><?php _e('Register', 'theme1392');?></a> <span><?php _e('or', 'theme1392');?></span> <?php wp_loginout(); ?>
                <?php } ?>
                

Everything has to eventually point to http://www.battlefieldknights.com/join-the-battlefield-knights/

3. How do I change the adminbar like you have here?

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Jun 8th, 2012 at 9:19 pm #16006
Raam Dev
Username: Raam
Staff Member

Hi Jeroen,

To disable the WP Admin Bar, add the following code to your theme’s functions.php file:

add_filter(‘show_admin_bar’, ‘__return_false’);

To manually set the login/logout link, you can simply change the code to something like this:

<?php if(is_user_logged_in()) { ?>
                <a href="http://example.com/logout-url-goes-here/">Logout</a> of your account
<?php } else { ?>
                <b><?php _e(' You have not yet registered to our club?', 'theme1392');?></b> <a href="<?php bloginfo('url'); ?>/join-the-battlefield-knights/"><?php _e('Register', 'theme1392');?></a> <span><?php _e('or', 'theme1392');?></span> <a href="http://example.com/login-url-goes-here">Log in</a>
<?php } ?>
                
Posted: Saturday Jun 9th, 2012 at 1:52 am #16041

Thanks Raam, I will try that out. Will let you know how it works out :)

Posted: Saturday Jun 9th, 2012 at 4:39 am #16046

This is what I made of it and it seems to work for me. I want to thank you because I realize this is not part of S2. I just wanted to get the login all uniform and not 2 or 3 different log in and out places.

<?php if(is_user_logged_in()) { ?>
               <a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a> of your account
<?php } else { ?>
                <b><?php _e(' You have not yet registered to our club?', 'theme1392');?></b> <a href="<?php bloginfo('url'); ?>/join-the-battlefield-knights/"><?php _e('Register', 'theme1392');?></a> <span><?php _e('or', 'theme1392');?></span> <a href="http://www.battlefieldknights.com/join-the-battlefield-knights/">Log in</a>
<?php } ?>
Posted: Monday Jun 11th, 2012 at 9:18 pm #16175
Raam Dev
Username: Raam
Staff Member

Thank you for sharing your solution, Jeroen! Glad to hear you got it working. :)

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.