Accessing post custom variables within a plugin – WordPress

I’ve tried the following method within a plugin:

get_post_meta($featuredPosts[$i]->ID, "Thumbnail", true);

within the following plugin code:

Read More
$featuredPosts = new WP_Query();
$featuredPosts->query('showposts=5&cat=1');

for($i=1; $i<=$featuredPosts; $i++) { // second for() loop for post slides
      while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); // loop for posts

           get_post_meta($featuredPosts[$i]->ID, "Thumbnail", true);

      endwhile;
}

unfortunately this doesn’t return any values 🙁


Any ideas guys?

Related posts

Leave a Reply

1 comment