I have the following function in functions.php page
function viewpost($num)
{
echo $num;
query_posts('order=dsc&cat=$num & showposts=2');
while (have_posts()) : the_post();
?> <span> <?php the_title(); ?>
<?Php
echo get_the_post_thumbnail();
the_excerpt();
?>
<?Php
endwhile;
wp_reset_query();
}
When I call viewpost function for values of viewpost(1)
(to view post from category one ) it shows correct values, but when I put the same function again viewpost(2)
(to view post from category 2) it shows the previous function values i.e. from category. What can I do to get the post from different categories by changing the passing value