Title: Rusty php query
Last modified: August 19, 2016

---

# Rusty php query

 *  [formica](https://wordpress.org/support/users/formica/)
 * (@formica)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/rusty-php-query/)
 * Hello
 * I have a simple ‘ish’ php query, I’m attempting to list posts from a single category
   and to include the thumbnails i’ve assigned to each.
 * I’m using p75GetThumbnail from ‘simple post thumbnails’. As you can see i’m echoing
   the ‘thumbs’ path in the img src and it’s working fine but only returning the
   img of the current pages thumbnail not listing the thumbs from each post.
 * Can anyone help please?
 *     ```
       <?php
       $thumbs = p75GetThumbnail($post->ID, 110, 110);
       ?>
   
       <?php
       $result = "<ul class='lcp_catlist'>";
       $catposts = get_posts('this_months_news='.$ID."&numberposts=".$NUMBEROFPOSTS);
       foreach($catposts as $single):
       	$result .= "<li><a href='";
       	$result .=get_permalink($single->ID)."'>".$single->post_title."<img src='$thumbs;' /></a></li>";
       endforeach;
       $result .= "</ul>";
       echo $result;
          ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [formica](https://wordpress.org/support/users/formica/)
 * (@formica)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/rusty-php-query/#post-1199362)
 * Cor blimey! just solved my own problem. Wonders will never cease.
 * Thanks anyway guys:
 *     ```
       <?php
       $result = "<ul class='lcp_catlist'>";
       $catposts = get_posts('this_months_news='.$ID."&numberposts=".$NUMBEROFPOSTS);
       foreach($catposts as $single):
       	$result .= "<li><a href='";
       	$result .=get_permalink($single->ID)."'>".$single->post_title."'<img src='".p75GetThumbnail($single->ID, 110, 110)."' /></a></li>";
       endforeach;
       $result .= "</ul>";
       echo $result;
          ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Rusty php query’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [formica](https://wordpress.org/support/users/formica/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/rusty-php-query/#post-1199362)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
