Title: Small Syntax correction needed
Last modified: August 19, 2016

---

# Small Syntax correction needed

 *  Resolved [matt_rix](https://wordpress.org/support/users/matt_rix/)
 * (@matt_rix)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/small-syntax-correction-needed/)
 * I have this small piece of code
 *     ```
       <?php
       $category = get_the_category(); ?>
   
       <?php $recent = new WP_Query("cat=$category[0]->cat_ID&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>	<?php the_title(); ?>
       ```
   
 * but my problem lies with this part
    `cat=$category[0]->cat_ID&showposts=1` . 
   I am complete noobie in PHP and i am confused how to use a variable along with
   others as arguments.

The topic ‘Small Syntax correction needed’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [matt_rix](https://wordpress.org/support/users/matt_rix/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/small-syntax-correction-needed/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
