WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Single Post in Category — the_content()

[Resolved] Single Post in Category — the_content()

  • jfburroway
    Member

    @jfburroway

    I’m trying to create a single “sticky” for a weekly podcast (postcasts are category 39) at the top of my blog. I want to display the title and the text. I can get the title to show up, but the text (the_content()) is blank.

    The same post shows up in the more conventional loop in the main part of the blog. What’s wrong?

    <?php
     $myposts = get_posts('numberposts=1&category=39');
     foreach($myposts as $post) :
     ?>
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <?php the_content(); ?>
     <?php endforeach; ?>

    the_permalink() and the_title() work fine, but the_content() returns nothing.

    test.boxturtlebulletin.com

Viewing 1 replies (of 1 total)
  • Same problem as in your other thread:

    <?php
     $myposts = get_posts('numberposts=1&category=39');
     foreach($myposts as $post) : setup_postdata($post);
     ?>
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <?php the_content(); ?>
     <?php endforeach; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Single Post in Category — the_content()’ is closed to new replies.