Usage of include WordPress on external page (4 posts)

  1. chewbears
    Posted 1 year ago #

    I run the following :

    <div id="blog">
        	  <div id="blog1">
        	  <a href="http://advanceperformance.com/news/?cat=14"><img src="images/feed_head_whatsnew.gif" width="250" height="25" alt="" /></a>
    <?php query_posts('showposts=3&cat=14'); ?>
          <?php while (have_posts()): the_post(); ?>
    	                       <div class="postmeta2">
    	                           <div class="meta2inner">
    	                               <div class="pday"><?php the_time('j'); ?></div>
    	                               <div class="pmonth"><?php the_time('M/y'); ?></div>
            <div class="text">
                        <h4><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h4>
            <a href="<?php the_permalink(); ?>">Read More...</a>
            <br />
            <?php endwhile; ?>

    And it works great but I am having trouble using
    <?php the_post_thumbnail();?>

    In order to get the first image out of the post and display.

    Any help would be greatly appreciated.


  2. Mark Senff
    Posted 1 year ago #

    Do you want to display the first image that's in the post content, or the featured image?

    the_post_thumbnail(); shows the image that is uploaded as the featured image -- not any images that are placed in the post content.

  3. chewbears
    Posted 1 year ago #

    Seriff, I am looking to display the first image that's in the post content.


  4. Mark Senff
    Posted 1 year ago #

    The image you want to show is part of the content -- it's a little tricky to try to pull it from the actual post content and then display it on an external page.

    Things would be easier if you would actually upload a featured image for your post. You don't have to show that image in your regular content, but if you want to show it on an external page, you can simply use the_post_thumbnail().

Topic Closed

This topic has been closed to new replies.

About this Topic