WHERE are you using that code on the index page? all that code is going to do is create a listing of post titles. The main WP loop is still going to run – if this code is before the loop, the list will be before the posts, if after the loop the list will be after the posts.
If you want that to run INSTEAD of the regular code you don’t want a wp_query command
rather
query_posts(“showposts=1&cat=3”);
the the regular WP loop
if (have_posts()): while (have_posts()) :
I’m using the code on the index page before the loop. I don’t want a list of posts. I am trying to pull the permalink of the latest post from a specific category.
Just try by using WP_Query(“showposts=1&cat=3”) to WP_Query(“cat=3&showposts=1”)
I have checked it on my temp blog, it works if we change the order of WP_Query parameters.
Use this. make sure to use a single ampersand and not & a m p ;
<ul>
<?php
$recent = new WP_Query();
$recent->query('showposts=1&cat=3');
while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
if it doesn’t work double check that 3 is the correct category ID code for your category