Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] Removing a Post from the Recent Posts Category (http://forum.bytesforall.com/showthread.php?t=6254)

Chloe Mar 12, 2010 08:46 AM

[SOLVED] Removing a Post from the Recent Posts Category
 
Hello,

Does anyone know if there is a way to remove a post from the recent post category, without deleting it? (I have a post that's really a news item but it's showing up in the recent post category.) www.womenscycling.ca/blog

Thanks in advance for your help.

Chloe

juggledad Mar 12, 2010 02:47 PM

You will either have to alter the posts date or edit the post to skip the specific post.

Chloe Mar 17, 2010 11:50 AM

Hi,

Because it's a "news" post I don't want to change the time stamp. Can you tell me what you mean by "edit the post to skip the specific post"?

Thanks for your help,
Chloe

Chloe Mar 17, 2010 01:06 PM

I found the answer in an older posting by Flynn

Get PHP widget and put this code in:

<ul>
<?php
$recentPosts = new WP_Query();
$recentPosts->query('showposts=5&cat=-XX,-YY,-ZZ');
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>

"showposts" is the number of posts you want to show and -XX,-YY,-ZZ are the categories you want excluded.

Thanks Flynn


All times are GMT -6. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.