• Resolved jonathonpratt

    (@jonathonpratt)


    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();
      ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • set them to the exact same category

    you are using the category ID in the code:

    'cat' => 16

    is that category ID still the same?

    Thread Starter jonathonpratt

    (@jonathonpratt)

    Thank you that was the problem. The new cat id was 14 not 16 and I didn’t remember to change it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem Showing only featured images from posts Please Help!’ is closed to new replies.