Was tweaking a query to pull current post category and the darn thing wasn’t working right until i declared global $post; . Just thought I’d warn the masses. Here’s the snippet:
<?php
global $post; //important!!
foreach(get_the_category() as $category) {
$cat = $category->cat_ID; }
query_posts('cat=' . $cat . '&order=DESC&showposts=-1'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
This entry was written by , posted on November 25, 2009 at 4:40 pm, filed under Uncategorized. Leave a comment or view the discussion at the permalink.