On the welcome screen of a recent web project, I was asked to create a function to allow visitors to receive a free audio file after they registered on a WordPress powered site. Now I’m sure there are a number of plugins that can easily do this task, however, I wanted to let WordPress do all the work. Right away I thought of the Template Tag – “is_user_logged_in”. The function is rather simple, it checks to see if the current visitor is logged in or not. Now here’s where you can have some fun and get your visitors to actually become registered members of your site.
So on the index page I created a very simple function:
<?php
if ( is_user_logged_in() ) {
echo 'Here is your free audio file! ';
echo '<a href="\http://www.yoursite.com/files/audio.mp3"\> FREE FILE!</a>';
} else {
echo 'Register to this blog today and receive a FREE audio file!';
}
?>
Rather simple. We are seeing if the current visitor is logged in, if so, give them their free gift, if not, ask them to register!
Now, of course, WordPress makes it possible to use this just about where ever you would want. Want to display a message to only users logged into your site AND are viewing the Contact page? Try this.
<?php
if (is_page('Contact') && is_user_logged_in()) {
echo 'Hello Registered Member, here are the latest updates!';
} else {
echo 'Hello Visitor, Please register for complete updates!';
}
?>
Of course, there is much much more that you can do with this Template Tag. You could even use this Template Tag within Sessions (view a welcome message during first page load, etc.).
Have any suggestions on how to further use Template Tag: is_user_logged_in()
I can’t believe this is the first I heard about this, but I’m not really all that surprised.
Take a read at this, “France warns against Internet Explorer use“.
Funny thing is, they are only playing follow the leader, apparently Germany did the same thing!
Exactly why I don’t use Internet Explorer! Go Firefox!
So things have been busy lately, very busy and don’t get me wrong, keeping busy is good. Well, usually. Did I mention I landed a “leading” role in a local play? Oh man, it was so much fun, stressful and sometimes scary, but oh so fun. I landed the role of Mr. Mushnik in the Jay County Civic Theater production of Little Shop of Horrors! Man what a blast. Sadly, the days of the show I began loosing my voice due to illness. But I mustered through. The entire cast was fun, very fun! It was a great time and for my first big role, it was great!
So today the Zune I ordered from Newegg.com awaited me in the mailbox. It looks so awesome. No it’s not my iPod Touch, but it really is a sharp looking device. This item was purchased refurbished at an amazing cost, but still it had all accessories and the original packaging. So I later decide to hook it up and see how it all works. Well I hooked it up and it seemed to be working fine. That is until it wanted to do some kind of update. It started the update and well that’s the last I saw of it. The Zune software said it was done and the device appeared to be rebooting. Little did I know it must have slipped into a “comma”. The damn thing is not turning on and is now not being recognized by my computer. Well that’s okay let me try another computer. So I start by loading the Zune software on the other computer, Error can not install. WTF! So here I am currently in limbo just hating this, this can’t be that hard! My iPod was a BREEZE compared to this. I’m so annoyed it’s not even bearable. Microsoft can you make a product that does work? Seriously? Don’t get me started on the problems I continue to have with my Xbox 360. Well the only thing I can say is that due to your unstable and problematic operating system, I have work! Thanks Microsoft, for nothing!
Damnit!
I have been working with a computer running Windows Vista Home Premium and was stuck with not knowing the password for the user account. Since Vista has done away with the “hidden” Administrator trick., I was forced to find another way in. I managed to find a great tool that worked like a charm. I found the Offline NT Password & Registry Editor from a Google search. After creating a simply boot-disk, I was able to clear the users password and was in under a couple of minutes. Tool works great!
http://home.eunet.no/~pnordahl/ntpasswd/