Title: the_content() doesn&#8217;t work&#8230;why?
Last modified: August 19, 2016

---

# the_content() doesn’t work…why?

 *  Resolved [Wpstar.it](https://wordpress.org/support/users/fraskio80/)
 * (@fraskio80)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/the_content-doesnt-workwhy/)
 * Hi everyone,
    i made the following template in order to create a private page
   and leave visible the link to all users, logged and not logged:
 *     ```
       <?php
       /*
       Template Name: Pagina Privata
       */
       ?>
       <?php get_header(); ?>
       <?php get_sidebar();
       $page_id = $_REQUEST['page_id'];
       ?>
       <div class="content">
   
       		<?php if(is_user_logged_in()): ?>
   
       		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       		<div class="post" id="post-<?php echo $page_id ?>">
       			<h4><?php the_title(); ?></h4>
       			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
       			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
       		</div>
       		<?php endwhile; endif; ?>
       	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
   
       		<?php else:?>
       			<h4>Pagina protetta da password.</h4>
       				<form name="loginform" id="loginform" action="http://localhost/area/wp-login.php" method="post">
       				<p>
       				<label>Nome utente<br />
       				<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
       				</p>
       				<p>
       				<label>Password<br />
       				<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
       				</p>
       				<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Ricordami</label></p>
       				<p class="submit">
       				<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Collegati" tabindex="100" />
       				<input type="hidden" name="redirect_to" value="<?php bloginfo('url');?>/?page_id=<?php echo $page_id;?>" />
       				<input type="hidden" name="testcookie" value="1" />
       	</p>
       </form>
   
       		<?php endif; ?>
   
       </div>
       <div class="clear"></div>
       <?php get_footer(); ?>
       ```
   
 * why i can’t see the page content?

The topic ‘the_content() doesn’t work…why?’ is closed to new replies.

## Tags

 * [the_content](https://wordpress.org/support/topic-tag/the_content/)

 * 0 replies
 * 1 participant
 * Last reply from: [Wpstar.it](https://wordpress.org/support/users/fraskio80/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/the_content-doesnt-workwhy/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
