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

How To Extend User Contact Info

WordPress 2.9 built with new ability to Extend User Contact Info, this tricks can be done by added some code on functions.php in your current theme. We can added many contact info, depend on your needed. To do extend user … Read More

Tutorial Enable HTML markup in user profiles

User profiles in WordPress is the perfect ways to display our information, such as website, Yahoo Messenger and many more. You can add some description about yourself on WordPress Profiles too. The problem is, default WordPress Profiles descriptio

How To Display Content for Admin Only

Display Specific Content for Admin Only in WordPress can be done easily, all need to do just write some if else statement with same parameter. On this example I will show you how to display simple stats from WordPress and … Read More

How To Display Recently Registered Users on WordPress

With little bit functions Display Recently Registered Users on WordPress with Gravatar is easy, we only need to write down little bit of code and the result will be displayed. This code is original resource from WP Recipes, we only … Read More

Create User-Friendly WordPress Shortcodes

WP Hardcore give nicely tutorial about how to Create User-Friendly WordPress Shortcodes. On the WP Hardcore example how to create better gallery shortcode and make it more user friendly. You'll need little bit knowledge in PHP, because on thi

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

Source: http://wptricks.net/show-data-for-registeredlogged-user-only/

How To Display Content for Admin Only / WordPress Tricks & Tips

Show Data for Registered/Logged User only / WordPress Tricks & Tips. Display Specific Content for Admin Only in WordPress can be done easily, all need to do just write some read more

Source: http://wptricks.net/how-to-display-content-for-admin-only/

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

Source: http://www.artio.net/book-it/documentation

PHP :: Display Logged In Username

if they're a registered/logged in DIFFERENT user Certain Pages Only When Logged In I'm trying to show the username of the logged in user on picking up the data from user read more

Source: http://php.bigresource.com/display-logged-in-username-RJ5PgJ78.html

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

Source: http://deals.woot.com/deals/details/54dd0013-cbda-4d0a-9824-50e5c04f311d/a-data-turbo-series-16gb-secure-digital-high-capacity-sdhc-flash-card-model-asd


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>