Forums

[resolved] Small Syntax correction needed (1 post)

  1. matt_rix
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic