Title: Need help for complex  qurey syntax
Last modified: August 19, 2016

---

# Need help for complex qurey syntax

 *  [xinfo](https://wordpress.org/support/users/xinfo/)
 * (@xinfo)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/need-help-for-complex-qurey-syntax/)
 * Hey guys
 *  i am trying to show latest post title(only) from particular category along with
   only one(1) image from those title
 * any one can help me to form this qurrey ?
    below is current qurey
 *     ```
       <div class="right">
       		<?php $recent = new WP_Query("cat=15&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
       <div class="archive">
       		<div class="thumb"><a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a></div>
       		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
   
       		</div>
       		<?php endwhile; ?>
       	</div>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/need-help-for-complex-qurey-syntax/#post-1145741)
 * Shouldn’t you use **showposts=1**?
 *  Thread Starter [xinfo](https://wordpress.org/support/users/xinfo/)
 * (@xinfo)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/need-help-for-complex-qurey-syntax/#post-1145778)
 * Your right if i want to show only 1 post title but i want to show 5 title and
   1 image from those title
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/need-help-for-complex-qurey-syntax/#post-1145862)
 * Look at [Function_Reference/get_children](http://codex.wordpress.org/Function_Reference/get_children)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Need help for complex qurey syntax’ is closed to new replies.

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/need-help-for-complex-qurey-syntax/#post-1145862)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
