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.