Marcos_Alexandre

Untitled

Apr 6th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2. if ( have_posts() ) :
  3.     while ( have_posts() ) : the_post();
  4.         $private = get_post_custom_values( 'private' );
  5.         if ( isset($private[0]) && $private == 'true' ) {
  6.      
  7.             if ( is_user_logged_in() ) {
  8.                 the_title();
  9.                 the_content();
  10.             }      
  11.      
  12.         } else {        // this is visible to all
  13.            
  14.             echo 'O conteúdo desta página é privado.';
  15.  
  16.         }
  17.  
  18.     endwhile;
  19. endif;
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment