Basically in my footer I have successfully retrieved the last 3 news articles using this code:
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink()?>" class="article">
<article>
<?php the_post_thumbnail(); ?>
<time><?php the_time('M d Y') ?></time>
<?php the_excerpt(); ?>
</article>
</a>
<?php endwhile;?>
Also, in the footer.php file I am trying to load Javascript files on specific pages like this:
<?php if ( is_page( 'contact' ) ) { ?>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="<?php bloginfo('template_url'); ?>/js/gmap.js"></script>
<?php } ?>
This also works but only when I remove the query_posts loop above. Whats the best way to show the last 3 posts (in the format outlined above) and successfully use IF statements to load in some JS/jQuery (to specific pages) both at the same time?