Display Featured Images From Pages on One Main Page
-
I am trying to display all my pages featured images in custom manner on one main page.
I have found this:
<?php $featured_image = new WP_Query(‘page_id=114’); ?>
<?php while ($featured_image->have_posts()) : $featured_image->the_post(); ?><?php if (function_exists(‘has_post_thumbnail’) && has_post_thumbnail()) { ?>
<?php $img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array( 205,168 )); ?>
<div class=”the-image”>
“><img src=”<?php echo $img_src[0]; ?>” />
</div><?php }; ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>It works, BUT only for a selected page and I want all my pages that have them. Also the permalink doesn’t work.
Any and all help would be great!!!
- The topic ‘Display Featured Images From Pages on One Main Page’ is closed to new replies.