Posted By

alexeihidalgo on 04/04/11


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

acousins
vrob
srdjan


to show content only for log-in users in wordpress


 / Published in: PHP
 

  1. <?php
  2.  
  3. if ( is_user_logged_in() ) {
  4.  
  5. ?>
  6.  
  7. //Logged in user stuff here...
  8.  
  9. <?php } else { ?>
  10.  
  11. <h3>You have to be a registered user to view this page</h3>
  12.  
  13. <?php } ?>

Report this snippet  

You need to login to post a comment.