I am trying to pass a variable into a query_posts( ) but for some reason it doesn't seem to be taking effect. I can echo the variable all over the place, and use it in places other than the query_posts( ), but not inside.
To be as brief as possible, I have a "Featured Article" on my main page, which is the newest post to my blog. I am trying to grab both the Category ID and Category Name from this and pass it down the page a bit to an "Recently In category_name" type of deal.
Here is the code from my single Featured Article area:
<?php query_posts('showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php $category = get_the_category();
$featured_NAME = $category[0]->cat_name;
$featured_ID = $category[0]->cat_ID;
?>
Now down in the "Recently In category_name" I am using the following:
<?php query_posts('showposts=3&cat=$featured_ID'); ?>
<h3>Recently In <?php echo $featured_NAME; ?></h3>
<?php while (have_posts()) : the_post(); ?>
The $featured_NAME inside my <h3> tags works great, but the query_posts( ) is completely ignoring my $featured_ID variable. It is just reading as "cat=" and showing the last 3 entries in all categories.
I've read through the docs and tried numerous things, but just can't get it to work.
Any suggestions?