multiple queries sorted by url string
-
I need to have multiple loops run on the index page sorted by category, this part is working. What isn’t working is the preservation of sorting posts by tags called in the url string. This is the function I’m using to query posts by category:
<?php function query_single_category($kat) { $category_id = get_cat_id($kat); query_posts($query_string . "&cat=$category_id"); if ( have_posts() ) : while ( have_posts() ) : the_post(); include("post-content.php"); endwhile; else : endif; } ?>
This is how I’m calling specific categories in the template:
<?php query_single_category('residential') ?>
Any ideas why this isn’t preserving the url string?
I’m pretty sure my syntax is correct, I referenced the codex…would it have something to do with referencing the $query_string variable in functions.php?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘multiple queries sorted by url string’ is closed to new replies.