Support » Plugin: LearnPress - WordPress LMS Plugin » Logout button?
1 year, 8 months ago
Hi, how do I create a custom logout button for students? When they login a logout link appears in the message text but that disappears when you click another page!
I am sorry about this. The function is not available now.
I am curious about this issue as well. @augustus09 are you saying that there is no way to add a ‘logout’ button or link to the lp-profile dashboard? Once logged in, how is a user supposed to logout???
What do you mean this function is not available now? It’s a basic security function lol.
edit. You just need to put it in the Profile menu
OK, I had a look at the code. You need to edit the LearnPress plugin to add a sticky logout to the top of the lefthand menu:
Ideally to prevent it being over written copy this page and put it in your child theme folder, if you have one, in /learnpress/profile/ folder (…or backup the page!)
Now edit profile-cover.php add the following after line 22 (i.e. after the avatar class div)
<div style="margin-left:1em"><?php echo sprintf( __( '%s', 'learnpress' ), sprintf( '<a href="%s">%s</a>', $profile->logout_url(), __( 'Logout', 'learnpress' ) ) ); ?></div>
Sesason to suit and serve warm 🙂