When finished this should be able to run in the sidebar/ as widget.
The following code should work. What am I overlooking?
<h2><?php single_cat_title() ?></h2>
<?php
$categoryvariable=$cat; // assign the variable as current category
$query= 'cat=' . $categoryvariable. '&orderby=date&order=ASC'; // concatenate the query
query_posts($query); // run the query
if ($myposts):
foreach ($myposts as $post):
setup_postdata($post);
the_title();
endforeach;
else :
// Nothing Found
endif;
?>
Thank you