Using the_post_thumbnail()
you can retrieve different sizes of the post featured image. It is important to enable post image by adding add_theme_support()
to your them functions.php
file.
1 2 3 4 5 6 7 8 |
<?php require('wp-blog-header.php'); ?> <?php define('WP_USE_THEMES', false); wp_head(); ?> <?php $posts = get_posts();?> <?php foreach ($posts as $post) : start_wp(); ?> <h1 id="<?=the_ID();?>"><?=the_title();?></h1> <?php the_post_thumbnail('thumbnail'); ?> <hr/> <?php endforeach;?> |