Jump to content

Recommended Posts

Posted

I'm developing a site for a client in a private directory on my web host that is running wordpress. In the clients site, I have a members section that requires a login. I'm having trouble with the logout url which when called will go to the wordpress logout screen when called. This is what I have for code:

<div class="login-message">Hello <?php echo $page->title; ?>. Welcome back. <a class="logout" href="?logout=1">Logout?</a></div>

I know that it will be fine in a live site but I need to show this functioning as intended for the client. Does anyone have any experience or suggestions on how to resolve this?

Posted

Why dont you call a pw page with this get variable?

Sth. like <?= $pages->get(1)->url ?>?logout=1

Posted

Do you perform the redirect before any html markup?

Make sure that the logout handler is called before <html>

Posted

strange,

for understanding, your use case:

User is in a PW environment and clicks on a link which sets a get variable to logout=1. 

After logging the user out you want to perform an redirect to the login page. 

So, you set up the following: 

template file with the logout button.

<? if($input->logout) logout and redirect ?>

<html><head>etc.. 

<a href="?logout=1">

Did I understood right?

Posted
There aren't any known issues installing PW inside WP, right?

I don't think that many have done this, so we can't say for sure what the issues might be. One that I am aware of is a name conflict between WordPress's gettext() functions and our language functions. Though not sure if it still matters if you aren't using multi-language. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...