Show Data for Registered/Logged User only


Sponsored Links




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.

Show Data for Logged User - Candice Swanepoel

Show Data for Logged User - Candice Swanepoel

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

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Show Data for Registered/Logged User only / WordPress Tricks & Tips

Daily The Best WordPress Tricks and WordPress Tips to make your WordPress nice Read More

Tutorial Added Adding Custom Buttons to Editor Wordpress

Show Data for Registered/Logged User only → 6 Responses to Tutorial Added Adding Custom Buttons to Editor Read More

Booking and Reservations Documentation - ARTIO

Registered: logged user with customer no logged user. Always has to fill their personal data into The Joomla user group for customers. Usually only Read More

A-DATA Turbo Series 16GB Secure Digital High-Capacity (SDHC) Flash

A-DATA Turbo Series 16GB Secure Digital High Woot may designate a user comment as a Quality Whatever it is you're trying to do can ONLY be done by registered, logged-in Read More

roles - Display navigation menu item conditionally based on user

tree that should only be accessible to a set of registered, logged-in users. I understand how to query a user's Add appropriate meta data Code needed to only show users Read More


4 Responses to Show Data for Registered/Logged User only

  1. Pingback: Tweets that mention How to Show Data for Registered/Logged User only # WordPress Tricks & Tips -- Topsy.com

  2. Show Only for registered user is a good point to create more sophisticated WordPress website

  3. Pingback: WordPress for Android | Unlock IMEI Cellphones

  4. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>