WordPress Tip: Function is_user_logged_in

A PHP function is available in WordPress called is_user_logged_in that is very useful if you want to know if a user is logged in.  Why on earth would you want to know this?  Have you ever thought about adding custom content to your blog that only you can see or only logged in (registered users) can see?

If so this function is for you.  I recently updated my blog’s theme and realized that it has some space that could be used for secondary navigation.  nolinks1 The area in red seemed to me like a great place for additional links.

This is where the function is_user_logged_in can help me out.   In this case the area highlighted in red has its own div tag.  It currently looks like this:

<div id=”nav-space”></div>

Inside the div tag I place the following 2 lines.

<?php if (is_user_logged_in()){ ?>
<?php } ?>

The 2 lines call the function is_user logged_in and evaluate the return value with my if statement. The second statement simply closes or ends the if. Do not worry if you do not understand.  Let me just tell you what it does.

Suffice it to say that anything you put between the 2 lines will be seen by logged in users only. For this example I am going to insert a link.

<div id=”nav-space”>
<?php if (is_user_logged_in()){ ?>
<a href=”http://www.google.com”>Google</a>
<?php } ?>
</div>

In the example just above a link to Google will be placed in the red area above that can only be seen by a logged in user.  In this case, me!

Now let’s put it in to practice.    I have added 3 links to the red bar section.  I now have access to facebook, friendfeed, and twitter right in my header section. I like this.  I think I will add some additional links later.

Now remember they will only display if you are logged in.  If you are like me you mainly use the same computers and stay logged in.  As long as you are logged in you will see your links.

Do you hang out on your own blog alot?  Would you like to use your own blog for a mini portal? Do you have free navigation space available?

This is great for me and adds functionality for my purposes but leaves the blog crisp and clean for visitors.  Try this WordPress trick in your theme today.

Declaring Your Social Media Independence

The Evolution of Social Media

I read an article this morning titled “The Evolution Of WordPress.”  WordPress is the fabulous CMS software that powers this blog.  Hack wordpress a great blog that I read was commenting on the changes and improvements the WordPress software has seen.

In the same way the advances in Social media are dramatic.  Systems, methods, and technologies that many rely on were not around or were in infant stages just 5 years ago. 5 years in technology terms is a enormous amount of time but in the real world 5 years is a blink of an eye.  The web as we know it has changed dramatically in the last 5 years.  Its modern inception is only a mere 15 years or so old.

Web applications have given this ‘have it now crowd’ nearly instant gratification.  I have commented before that I am amazed at the feature development of some of the current Web apps.  Just bursting into prominence in the last 6 months or so FriendFeed and Toluu continually wow me with enhancements.

Social Media Addiction

Do you remember life before a cell phone?  Perhaps the cell phone era is difficult to remember we have come to rely on them so heavily. Now when I leave my cell phone at home despite $4 a gallon gas prices I turn the car around and go back for the phone.

I think many of us have the same thoughts about social media.  We have become so attached to Twitter, FriendFeed, Facebook, and any other social media application that application failure is devastating.

The twitter addicts have been hunting all over for a place to get their fix.  They have stirred the blogosphere into a buzz over start-ups like Plurk and identi.ca.

The twitter addicts seem to have become attached to Twitter in the same way they are attached to power, water, and other necessities of life.  They seem to be the most rabid.  But I venture to say that Gmail, FriendFeed, or Google Reader went down in the way twitter has I would be equally as frantic.  Social media addiction is prominent.

Declare Your Independence

I challenge you to declare your independence from Social media at least for some period of time.  Declaring your independence will assist you in breaking your cycle of addiction.  This should assist in the event that your favorite application goes down or becomes unreliable.  So take a break from social media.

Perhaps we should stop for a minute and smell the fresh air.  It is summertime. We should take a break and get outdoors.  We could take our families on vacation.  I recently saw a user friendfeeding on vacation from the beach.  This flickr image appeared in the friendfeed stream posted from the beach.  Could the addiction be anymore evident?  No friendfeeding or twittering during family time.   Take a break so you can appreciate and enjoy social media later.

Zemanta Pixie

My Blog Has Been Louis Grayed!

Yes this is a good thing.  In fact it is a very good thing.   Louis Gray is one of the premier Tech bloggers writing today.  I visit his site daily and even have an email subscription to make sure I do not miss a post.

Louis has shown great interest and respect for the small unknown blogger.  Since March he has been profiling 5 Blogs a month.   March, April, May and June.  The small blogs he has spotlighted have taken off and many are must reads in my google reader now.  These blogs have included Hutch Carpenter, Charlie Anzman, SheGeeks, Julian Baldwin, Michael Fruchter, Mark Dykeman, Colin Walker, Alexander van Elsas, and many other outstanding blogs.

I am honored to be included in the list for July.  I am included in great company.  I already subscribe to two of them.  I have already been reading Nathaniel Payne’s NerdFlood and David Risley but can not wait to check out the other two as well.  Here is the list:

1) Bob Warfield / SmoothSpan Blog (smoothspan.wordpress.com)

2) Jesse Stay / Stay N’ Alive (www.jessestay.com)

3) Franklin Pettit / FPettit.com (www.fpettit.com)

4) Nathaniel Payne / NerdFlood (www.nerdflood.com)

5) David Risley / DavidRisley.com (www.davidrisley.com)

Thanks Louis for the link and mention.   I am honored to be in the company of your monthly featured bloggers.  I better get posting.  I currently have 33 open drafts in WordPress.  It is time to finish some off and put out more content.

Zemanta Pixie

Excuses, WordPress, & Blogging

For the past 6-8 weeks I have been tech blogging. Well at least a little. I have managed to post sporadically with a quest to post regularly. Sporadically is probably the best I can do for now. I tried blogging before and had given up on it. But this time I think it has stuck. I will maintain this blog and try to post daily but at least once a week.

As a new blogger I have been working to spruce up the site. I have been researching many WordPress themes, many sidebar widgets, and lots of tweaks for the blog. Several months ago I added the Disqus plugin for threaded commenting. Disqus is great! If you do not use it for your WordPress blog you should really give it a try. Installation is easy and it works great. One of my favorite features is the commenting by email reply .

During the past week I have been looking at WordPress themes and wordpress theme development. The main process in a wordpress theme that displays your posts is called “The Loop.” The loop looks like this:

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

//Code here would display and format the post.

<?php endwhile; ?>

All wordpress themes have the_loop but some have more than one. Some premium themes and magazine style themes may also display post excerpts in a sidebar or else where on the page. They have multiple loops. The following is a list of links that I have viewed as I was researching multiple wordpress loops.

I looked at ways to enhance my theme with category pages. I wanted a specific verbiage at the top of each category page. Here are some relevant links:

As I stated I have been looking at many different wordpress themes. It is good to choose a theme and stick with it. Here are couple places to take a look at themes:

I decided on Cutline by Chris Pearson for now. It is a 3 column theme. But I intend to tweak it further by changing the theme’s pages, categories, sidebars, and general setup.

Here a couple more general WordPress links:

One more thing. So you want to play with new themes, or just tweaking your site. One thing you can try is installing WordPress locally. So you do not have a Linux machine? No problem, XAMPP to the rescue.

XAMPP is a free, cross-platform web server, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages.

XAMPP lite contians just what you need. XAMPP is zipped and requires no install. There is even a portable apps version of XAMPP. XAMPP contains everything needed to run WordPress. Check out the following link:

This link gives you step by step instructions to get your local WordPress install up and running.

I like this blogging thing no more excuses but to post.