Recent Posts in sidebar.php
-
I’m looking for a little help on an issue with code I found for “recent posts” in my sidebar.
the php is this:
<h2>Recent Posts</h2>
<?php query_posts /* enter # of posts here—-> */(‘showposts=10’);/* For a full list of possible arguments you can pass to query_posts see http://codex.ww.wp.xz.cn/Template_Tags/query_posts */?>-
<?php while ( have_posts() ) : the_post(); ?>
- ” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?>
<?php endwhile; ?>
I placed this in my sidebar.php.
<?php include (TEMPLATEPATH . “/recent_posts.php”); ?>
I want the Recent Posts to look like the Related Sites and Log in sections at the bottom of the sidebar. Also I would like to it to not include certain categories (i.e. Best Bets and Video).
Any help anyone could offer would be great. I read something on template tags/query posts that I thought might have been the solution but it wasn’t making sense.
Thank You,
Indiepunk
http://www.anti-fascion.com
-
I’ve been blindly trying all afternoon to add query post code in my recent posts.php but I’m not getting anywhere. This one changed the list but not in a way that was by category that I can tell.
<?php query_posts (‘cat=-1,-2,-3’); ?>
I can’t figure out how my categories are numbered to start. Where would that be indicated? Even if I do know how they are numbered I’m not sure if the code is really doing anything. Is this meant for the index page only or does it work elsewhere? Anyone? Bueller?
The topic ‘Recent Posts in sidebar.php’ is closed to new replies.