• Resolved thomas-tolleson

    (@thomas-tolleson)


    Hello!

    I have a category for which the posts will consist of a title and body text (which WordPress does by default), but also an image. I’m able to add an image to the body of the post, but the loop I’m using doesn’t publish the image to the page. The loop I’m using is:

    <?php query_posts('cat=10&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
            <li><h2><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a> </h2> </li>
    <p></p>
    <li>
    <div class="body">
    <strong><?php the_content(); ?></strong>
     </div>
    </li>
            <?php endwhile; ?>

    I assumed that <?php the_content(); ?> would publish all the content of the body, but it only seems to publish text.

    Is there something wrong with my loop, or is there a better way to attach images to posts (as a custom field or something?)

    Thanks!

    THT

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Best Practice for including images in posts’ is closed to new replies.