PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Logged In User php code? Not working

s2Member Plugin. A Membership plugin for WordPress®.

Logged In User php code? Not working

Postby pbul2004 » February 14th, 2011, 8:07 am

Hi,

In the php files and posts/pages i am using this: -

<a href="<?php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; ?>">My Account</a>

However i want to use this in the sidebar but it keeps going else where to random pages?

If i take a copy of the link address it looks like: -
www. zerogravitysafety.co.uk/%3C?php%20echo%20S2MEMBER_LOGIN_WELCOME_PAGE_URL;%20?%3E

Dont know why it is going to this link above. ^

Is there another way of writing this so it will work in the sidebar? Cheers.
User avatar
pbul2004
Registered User
Registered User
 
Posts: 11
Joined: August 18, 2010

Re: Logged In User php code? Not working

Postby stowe39 » February 15th, 2011, 8:50 pm

I'm not sure how your theme is coded, but I add links in the side bar by opening the sidebar.php file in the theme and pasting in some code like this

Code: Select all
<ul>
<li>
   <h3 class="sidebartitle" >Heading Above Link</h3>
   <ul class="list-rec">
   <li>
   <a  href="http://yourdomain.com/wordpress/?page_id=xxx">Name of Link</a>
   </li>
   </ul>
</li>
</ul>


Your class names might be different - check what class names the existing links in the sidebar.php have.

Cheers

Kym
User avatar
stowe39
Registered User
Registered User
 
Posts: 22
Joined: February 15, 2011

Re: Logged In User php code? Not working

Postby pbul2004 » February 16th, 2011, 4:28 am

Every user has a different page, so i cant hardcode the link with the page id on, as there could be 100 different users with different page names/ids.

This works : -
<a href="<?php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; ?>">My Account</a>

Basically whoever logs in this link will take them to their own client area page.

But when i want to use this in the sidebar it doesn't work.

I was wondering if there is another way of writing this so it will work in the sidebar text widget?
User avatar
pbul2004
Registered User
Registered User
 
Posts: 11
Joined: August 18, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot] and 2 guests

cron