Community Support Forums — WordPress® ( Users Helping Users ) — 2011-03-30T03:05:30-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=2856 2011-03-30T03:05:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8603#p8603 <![CDATA[Re: Hide login link for members]]>
Thanks guys for all your help. You've been superb. It's very much appreciated.

Brian

Statistics: Posted by bennisb — March 30th, 2011, 3:05 am


]]>
2011-03-29T21:39:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8588#p8588 <![CDATA[Re: Hide login link for members]]>

Statistics: Posted by Cristián Lávaque — March 29th, 2011, 9:39 pm


]]>
2011-03-29T20:40:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8580#p8580 <![CDATA[Re: Hide login link for members]]>
edit the file and add the code provided and save..

it should work...if not then edit your file and copy your backup and save...

There is a plug in where you can execute php into your widgets..i think it's called wp php widget

humm...here's the link: http://wordpress.org/extend/plugins/wp-php-widget/

Try this first..if it works then you don not have to edit any page..just add it like you add any side bar widget and add the code inside....:)

Good luck

Sam

Statistics: Posted by drbyte — March 29th, 2011, 8:40 pm


]]>
2011-03-29T18:45:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8566#p8566 <![CDATA[Re: Hide login link for members]]>
Maybe you can use shortcodes there, though. Here's my shortcode version of what I gave you earlier.

Code:
[s2If is_user_logged_in()]
   <p>Welcome [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]!</p>
[/s2If]

[s2If !is_user_logged_in()]
   <p><a href="http://www.pensionforecast.org.uk/join-and-become-a-member/"><img src="http://www.pensionforecast.org.uk/images/member.gif"></a></p>
   <p><a href="http://www.pensionforecast.org.uk/wp-login.php?action=login">Member Login &raquo;</a></p>
[/s2If]


I hope that works for you. :)

Statistics: Posted by Cristián Lávaque — March 29th, 2011, 6:45 pm


]]>
2011-03-29T10:42:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8555#p8555 <![CDATA[Re: Hide login link for members]]>
Thanks for the reply. I think I can make amendments through the Thesis custom file editors (custom.css and custom_funtions.php). I'm not a programmer, so I'm not sure how this would work. Thesis doesn't recommend playing with the code, just making changes through these files, so that when updates are done, the changes won't be lost. Any thoughts?

Brian

Statistics: Posted by bennisb — March 29th, 2011, 10:42 am


]]>
2011-03-29T04:40:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8543#p8543 <![CDATA[Re: Hide login link for members]]>
you need to place the code within the WP loop

are you using the codes inside your templates or using a WP page? Remember these are not short codes..so they wont work using the WP editor or a text side widget for that matter...unless you have one of them Php plugins where you can use Php inside a page or a widget....which i really DO NOT recommend

Sam

Well after looking at your site..you are using Thesis Themes...not sure if you have access to the theme itself to play with the code...If not then you are limited some how.....there are so many FREE and well done themes ...Check Jason themes ..they are well written and works well with S2...http://www.primothemes.com/category/premium-wordpress-themes/

Statistics: Posted by drbyte — March 29th, 2011, 4:40 am


]]>
2011-03-29T03:08:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8541#p8541 <![CDATA[Re: Hide login link for members]]>
Thanks for your help, but neither quite works. Here's Cristian's...
Image

And here's drbyte's...
Image

Here's the code without either code suggestion...
Code:
<center>
<a href="http://www.pensionforecast.org.uk/join-and-become-a-member/"><img SRC="http://www.pensionforecast.org.uk/images/member.gif" ></a>
<p>
<a href="http://www.pensionforecast.org.uk/wp-login.php?action=login" align="right"><strong>Member Login &raquo;</strong></a>
<p><br>
<INPUT TYPE="image" SRC="http://www.pensionforecast.org.uk/images/bec.jpg" >
<P>
<B>
>> GET OUR FREE EBOOK <<
<P>
PERFECT PENSION PLANNING
<p>
Answers to the 7 vital questions you must ask to build the best retirement income</b>
<P>
Enter your email address and hit GET IT NOW
<form method='POST' action='http://www.whoelsewantsto.com/cgi-bin/arp3/arp3-formcapture.pl'>
<div>
<input type='text' name='email' size='30' >
<input type='hidden' name='subscription_type' value='E'>
<p>
<INPUT TYPE="image" SRC="http://www.pensionforecast.org.uk/images/go.gif" height="20" ALT="Submit Form" hspace="0" vspace="0" border="0">
</div>
<input type='hidden' name='tracking_tag' value='PensionForecastFreeReport'>
<input type='hidden' name='id' value='67'>
<input type='hidden' name='extra_ar' value=''>
</form>
<p>
Your email address will never be shared</p></center>


It looks like this...
Image

Thanks.

Brian

Statistics: Posted by bennisb — March 29th, 2011, 3:08 am


]]>
2011-03-28T23:22:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8538#p8538 <![CDATA[Re: Hide login link for members]]>
Code:
<li>
    <?php if(is_user_logged_in()){ ?>
   <?php } else { ?>
    Returning Members?&nbsp;
<?php } ?>
   
   <?php if(is_user_logged_in()){ ?><?php global $current_user;
      get_currentuserinfo();
     echo '' . $current_user->display_name . "\n"; ?> - <?php } else { ?><?php } ?>
   
   
    <?php wp_loginout(); ?></a><span style="font-weight: normal;">&nbsp;| <?php if(is_user_logged_in()){ ?>
      <a href="https://www.yoursite.com/my-account">Your Account</a>
      <a href="https://www.yoursite.com/help-pro">Membership Help</a>
      and so forth

<?php } else { ?>
<?php } ?>
     </span></li>


Sam

Statistics: Posted by drbyte — March 28th, 2011, 11:22 pm


]]>
2011-03-28T19:38:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8528#p8528 <![CDATA[Re: Hide login link for members]]>

The error wasn't what caused what you have coming up in your page, though. Could you show me what's around it in your code too?

Statistics: Posted by Cristián Lávaque — March 28th, 2011, 7:38 pm


]]>
2011-03-28T16:19:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8518#p8518 <![CDATA[Re: Hide login link for members]]>
Thanks for your reply. I've added to the code to the multimedia box, but it displays a load of code on the page as you can see here - http://www.pensionforecast.org.uk/ Login works, but the code still remains. You can log in using test and test to see what I mean.

What can I do to correct the code, please?

Brian

Statistics: Posted by bennisb — March 28th, 2011, 4:19 pm


]]>
2011-03-28T13:48:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8510#p8510 <![CDATA[Re: Hide login link for members]]>

By the way, that error was just to let you know that if you use PHP code in the post, you shouldn't go back to the visual editor, just remain the code one.

OK, so you want the box on the right to change the login message if the person is logged in. Yes, conditionals will do the trick for you. Please read the documentation here WP Admin -> s2Member -> API / Scripting -> Advanced Query Conditionals

You'll be using the function is_user_logged_in(). So your code could be something like this:

Code:
<?php
if 
(is_user_logged_in()) {
    echo '<p>Welcome', S2MEMBER_CURRENT_USER_FIRST_NAME, '!</p>';     
} else {
    echo '<p><a href="http://www.pensionforecast.org.uk/join-and-become-a-member/"><img src="http://www.pensionforecast.org.uk/images/member.gif"></a></p>',
         '<p><a href="http://www.pensionforecast.org.uk/wp-login.php?action=login">Member Login &raquo;</a></p>';
}
?>


Hope that helps. :)

Statistics: Posted by Cristián Lávaque — March 28th, 2011, 1:48 pm


]]>
2011-03-28T13:29:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8508#p8508 <![CDATA[Re: Hide login link for members]]>
Thanks for your reply.

I installed the plugin you suggested. I added to the code to the top of the Login Welcome Page. I then got this warning...

Exec-PHP WYSIWYG Conversion Warning. Saving this article will render all contained PHP code permanently unuseful. Even if you are saving this article through the Code editor. You can turn off this warning in your user profile. Ignore this warning in case this article does not contain PHP code. Read the Exec-PHP documentation if you are unsure what to do next.

I deleted the code and didn't save the page!

Is this the right place for the code you suggest, given the only place I want to hide the login link is in the multimedia box in the right hand column - http://www.pensionforecast.org.uk (if the person is logged in).

Brian

Statistics: Posted by bennisb — March 28th, 2011, 1:29 pm


]]>
2011-03-28T12:31:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8502#p8502 <![CDATA[Re: Hide login link for members]]>
Code:
<?php
    $current_user 
= wp_get_current_user();
    echo esc_html($current_user->display_name);
?>


This assumes that the person is logged in, since its the Login Welcome Page, and that's why I'm not checking for that.

Also, you'll need this plugin for PHP code to work in your WP page https://wordpress.org/extend/plugins/exec-php/

Hope that helps. :)

Statistics: Posted by Cristián Lávaque — March 28th, 2011, 12:31 pm


]]>
2011-03-28T09:51:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2856&p=8494#p8494 <![CDATA[Hide login link for members]]>
At http://www.pensionforecast.org.uk, I have a member login link which I've put in the multimedia box. When a member logs in, I'd like to replace it with their name, so it says: Welcome FirstName. I think this is done with conditionals, but I don't know how or where to place the code needed. Can anyone help, please.

Thanks.

Brian

Statistics: Posted by bennisb — March 28th, 2011, 9:51 am


]]>