Problem Showing only featured images from posts Please Help!
-
Ok, this maybe an easy fix but I am so frustrated, I need fresh eyes to help me out. I designed and coded a WordPress theme for my buddies business, and I used a flexslider style jQuery plugin in which I made a code to pull strictly the Featured images from posts in a certain category to display in the slider. So I installed wordpress on our new hosting and uploaded my theme. I created the posts with the featured images and set them to the exact same category. But now wordpress is no longer pulling the featured images. I’m stumped.
The link to demo site: Click Here
Here is the code I used to pull featured images from posts:
<?php
$featureThumb = new WP_Query(array(
‘post_type’ => ‘post’,
‘order’ => ‘DESC’,
‘orderby’ => ‘date’,
‘posts_per_page’ => 4,
‘cat’ => 16
));while ($featureThumb->have_posts()) : $featureThumb->the_post();
if (has_post_thumbnail($post->ID)) {
$retina = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘homepage-thumb-retina’ );
echo ‘- ‘ . ‘<img src=”‘ . $retina[0] . ‘” alt=”‘ . ‘” width=”auto” height=”auto” />’ . ‘
‘ ;
};
endwhile;unset($featureThumb);
wp_reset_query();
?>
- The topic ‘Problem Showing only featured images from posts Please Help!’ is closed to new replies.