Title: the_content() doesn&#8217;t work even though using setup_postdata()
Last modified: August 18, 2016

---

# the_content() doesn’t work even though using setup_postdata()

 *  [theresac](https://wordpress.org/support/users/theresac/)
 * (@theresac)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/the_content-doesnt-work-even-though-using-setup_postdata/)
 * the_title(), the_excerpt(), etc work just fine, but I can’t get the content to
   display.
 *     ```
       <!-- if front page, display front page articles only -->
       	<?php if (is_home()) :
       	 $myposts = get_posts('numberposts=1&category=19');
       	 foreach($myposts as $post) : setup_postdata($post); ?>
       		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
       		<?php the_content();
       	endforeach; ?>
   
       <!-- if not the front page, do the following -->
       <?php else : ?>
        ...
       ```
   
 * I thought adding setup_postdata() would solve the problem, but it doesn’t seem
   to.

Viewing 1 replies (of 1 total)

 *  [triplex2k7](https://wordpress.org/support/users/triplex2k7/)
 * (@triplex2k7)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/the_content-doesnt-work-even-though-using-setup_postdata/#post-591862)
 * Does the_content really have any advantages over the_excerpt?

Viewing 1 replies (of 1 total)

The topic ‘the_content() doesn’t work even though using setup_postdata()’ is closed
to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [triplex2k7](https://wordpress.org/support/users/triplex2k7/)
 * Last activity: [18 years, 11 months ago](https://wordpress.org/support/topic/the_content-doesnt-work-even-though-using-setup_postdata/#post-591862)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
