With tiny step, we can display menu or messages for currently logged for registered user in WordPress. We only need added extra function and done. On this tricks we will give some example. If have wrote similar tricks but this method use another one.
The first sample is added extra menu for logged user.
<ul>
<?php // add a private menu
if(current_user_can('read_private_pages')) : ?>
<li><a href="<?php echo get_permalink(10); ?>">For Authors only</a></li>
<?php endif; ?>
</ul>
The second example is, Added Extra messages for currently logged user only.
<ul>
<?php // add a custom messages
if(current_user_can('read_private_pages')) : ?>
<div class="messages"><h3>Hello Currently Logged user</h3></div>
<?php endif; ?>
</ul>
That’s all, I hope our today tutorial are enough for you, if you have another WordPress Tricks, you can Submit it.
Photos courtesy of Popoholic




Pingback: Tweets that mention How to Show Data for Registered/Logged User only # WordPress Tricks & Tips -- Topsy.com
Show Only for registered user is a good point to create more sophisticated WordPress website
Pingback: WordPress for Android | Unlock IMEI Cellphones
Thanks for showing me this code. I actually now use it to hide ads from logged in admins (aka me) so I do not accidentally click on it!