Page 1 of 1

Logged In User php code? Not working

PostPosted: February 14th, 2011, 8:07 am
by pbul2004
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.

Re: Logged In User php code? Not working

PostPosted: February 15th, 2011, 8:50 pm
by stowe39
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

Re: Logged In User php code? Not working

PostPosted: February 16th, 2011, 4:28 am
by pbul2004
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?