if logged in
-
I put the following into the text widget:
<?php if ( is_user_logged_in() ) {
[standout-css3-button href=”<?php echo wp_logout_url( get_permalink() ); ?>”]Logout[/standout-css3-button]
} else {
[standout-css3-button href=”/#login-box”]Login[/standout-css3-button]
}
?>It shows up like this on my website (where it says (Login) is where my login button is and it works fine):
Logout } else { (Login) } ?>I have put ‘add_filter(‘widget_text’, ‘do_shortcode’)’ into the functions.php file for my theme so that short codes work in widgets.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘if logged in’ is closed to new replies.