Page loading ..
The FREE Online Tips Blog
Twitter | Facebook | Yahoo | Google | Firefox | Gmail | Security | Tools | more..

How to check login status in Wordpress blog

October 31, 2006 under Wordpress Tips, Blogging Tips Bookmark / Share this Tip..
Advertise here
Prashant
asked
My blog runs on Wordpress. I like to play with my blog template. I am not a tech savvy guy like you but I love to customise my blog and add new features just like this blog. I will like to know how to check if I am logged in or not and show the status in the sidebar like in this blog. My blog is hosted at Blogsome.
Ramnath’s
tip
Hi Prashant and welcome to the WebTips community. You need not be a ‘tech savvy guy’ guy to continue your blogging efforts. But you know some basic things. Ok heres the tip you asked for ..

Login to your blog cpanel and go to Manage and then to Files The file you see (index.html) is the main template and this is where you operate the whole look and feel of your blog. Inside body tag just add this smarty code:

{capture name=islogin}{wp_loginout}{/capture}
{if $smarty.capture.islogin|strip_tags:'0' == "Logout"}
Logout link (/wp-login.php?action=logout)
{else}
Login link (/wp-login.php)
{/if}

From now on if you are logged in to your blog you will see the ‘logout’ link and vice versa (just like the one at the top nav bar of this site). Save your work and see the result :) Let us know if you have any further queries.

2 Responses to How to check login status in Wordpress blog

xytsun on March 8, 2007

翻译公司

Claude Gelinas on May 13, 2007

That’s not the kind of code I can come up with although it fairly easy to understand and tweak, if necessary.

Does this mean WordPress is built using Smarty templates?

Leave a Reply »

For any queries mail us at: rabanerjee@gmail.com




Keep Discovering WebTips » 2 | 3 | 4 | 5



Blog Desiged & Programmed by Ramnath | Launch your free blog at Blogsome

Powered by WordPress


Monitored by Pingdom