How to check if user logged in or not in WordPress?

Often many times, you might be searching for the wordpress code which checks  if the user logged in or not.  Its no brainer and amazingly simple!

There could be at many parts of your site (say in header.php) ,  you want to show only certain links when the user is already registered and logged in like myaccount, logout page.

Here is the code…

<?php if ( is_user_logged_in() ) {
    global $current_user;
    if ( isset($current_user) ) {
        echo 'Welcome ' . $current_user->user_login . ' | ';
        echo '<a href="' . wp_logout_url( get_permalink()) . '" title="Logout">Logout</a>';
} else {
    echo 'Welcome, visitor!';
} ?> 

Refer to is_user_logged_in() function in wordpress site.

Top 25 Vibrant Personalities of Social Media

Top 5 Social Media Celebrities from Business

  • Bill Gates
  • Richard Branson
  • Larry Page
  • Kai-Fu Lee
  • Tom Anderson

Top 5 Celebrities on Social Media from Sports

  • Cristiano Ronaldo
  • Ricardo Kaka
  • Lionel Messi
  • David Beckham
  • LeBron James

Top 5 Social Media Celebrities from Politics

  • Barack Obama
  • Mitt Romney
  • Michelle Obama
  • Henrique Capriles Radonski
  • Sarah Palin

Social Media Top Celebrities from Music Industry

  • Justin Bieber
  • Lady Gaga
  • Rihanna
  • Katy Perry
  • Shakira

Top 5 Social Medial Celebrities from Hollywood

  • Jennifer Lopez
  • Will Smith
  • Jackie Chan
  • Adam Sandler
  • Dwayne Johnson

Web Design Trends for 2013

Today we’re doing a review of the end conclusions, where we will identify and analyze 10 of the key trends.

All these things and more are explored in our 20 must-know web design and development trends for 2013

What will be those key trends?

  1. Content first
  2. Simplicity of design interaction and content
  3. UX Centered Design
  4. App style interfaces
  5. The Inification of Desktop and Mobile into a Single version
  6. SVG, Responsive Techniques and Retina Support
  7. Flat color and No more skeuomorphism
  8. Whitespace & Minimalism
  9. Adopting HTML5 in favour of Flash
  10. Larger fonts, larger headings
  11. coding languages (as in HTML/CSS/Javascript)
  12. Fixed Header Bars
  13. Minimalist Landing Pages
  14. Large photo backgrounds
  15. CSS Transparency
  16. CSS3 Animations & Interactive
  17. Social media badges
  18. Infinite scrolling
  19. Homepage feature tours
  20. Sliding panels
  21. Parallax design
  22. Technology Agnostic
  23. Experimentation and innovation in device sensors and interaction
  24. The internet of things
  25. Digital QR Codes
  26. Mobile Navigation Toggle
  27. APIs and Open Source
  28. Deep Box Shadows
  29. Single-Page Web Design
  30. Circular Design Elements
  31. Large, large call to actions and buttons
  32. Leaner, performance-focused websites
  33. Loading screens

Top recommended fonts from Google Web Fonts

You will find many criticisms of the quality of GWF's fonts and the amateurish nature of many of these typefaces. Google fonts is a collaborative open source project but many people think there should be a higher level of quality control.
  1. Open Sans
  2. Josefin Slab
  3. Arvo
  4. Lato
  5. Vollkorn
  6. Abril Fatface
  7. Ubuntu
  8. PT Sans + PT Serif
  9. Old Standard TT
  10. Droid Sans

Redirect Google Image Traffic To Website Or WordPress Blog

Below I am listing out few of the code snippets. You have to just copy them and paste them to your header or footer location. If you are using Joomla or Drupal ( even if you are using wordpress ), you have to just copy the code and place. Almost every modern theme or templates gives you option to place addition script. You can use them too.

Remember that this methods doesn’t affects SEO

Code Snippet : Compressed Format


<script type="text/javascript" language="’Javascript’">// <![CDATA[
if(parent.location != self.location){parent.location=self.location;}
// ]]></script>


Code Snippet : Expanded Format


<script type="”text/javascript”">// <![CDATA[
 if (parent.frames.length > 0) { parent.location.href = location.href; }

// ]]></script>

Both of the scripts provided above perform the same function. They will also not affect your website speed ( their total size is just few bytes ) or SEO at any cost. According to Google, every blogger is fully copyright holder of their images. So if you are redirecting google image traffic to your website, then you aren’t doing anything wrong.
Please make sure you copy the exact code. Although this is not going to affect your site presence, but if you miss anything, and it won’t work.