I have a PHP snippet that I am trying to add to my sidebar before the main loop. It works fine when I add it after:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
It doesn't work when I add it before the loop. Does a PHP guru out there know what I can add to the snippet to get it to work before the loop?