Check out THEMEFRAME Beta
Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get support from the author &
additional benefits (soon), based on your donation level. Your forum name will be highlighted.
Not a member yet? You can still donate. And once you become a forum member, send a Private Message ("PM") to Flynn mentioning your Paypal email address so your donation can be added to your user name.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

Exclude category from Recent Posts in sidebar


  #1  
Old Mar 19, 2009, 02:05 PM
paulae's Avatar
paulae
 
1,178 posts · Feb 2009
Wordpress 3.0, Atahualpa 3.5.3
Treasure Chest Member  Greenback Member - Level 2 
I do not want the latest obituary posts showing up in the Recent Posts sidebar widget on the left.
http://larchmontgazette.com/wp27/

I want to be able to exclude obituaries and maybe some other categories, in the future, from the sidebar widget. I tried the Advanced Category Excluder plugin, but it didn't do a thing for me. I don't see any other likely plugins when I search the Wordpress plugin directory.

Help!
  #2  
Old Mar 20, 2009, 03:48 PM
Flynn's Avatar
Flynn
 
3,382 posts · Oct 2008
Munich, Germany
Use one instance of the PHP code widget http://wordpress.org/extend/plugins/php-code-widget/ and inside the widget put:
PHP Code:
<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>
In showposts=5&cat=-XX,-YY,-ZZ replace 5 with amount of posts and XX, YY and ZZ with the ID's of the categories that should be excluded
  #3  
Old Mar 20, 2009, 04:24 PM
paulae's Avatar
paulae
 
1,178 posts · Feb 2009
Wordpress 3.0, Atahualpa 3.5.3
Treasure Chest Member  Greenback Member - Level 2 
I got it working, thanks!

Very nice.

You're the best!

Last edited by paulae; Mar 20, 2009 at 04:54 PM.
  #4  
Old Apr 21, 2009, 06:18 PM
Flynn's Avatar
Flynn
 
3,382 posts · Oct 2008
Munich, Germany
That's kinda funny, I just googled for this and found my own post
  #5  
Old Apr 21, 2009, 07:23 PM
paulae's Avatar
paulae
 
1,178 posts · Feb 2009
Wordpress 3.0, Atahualpa 3.5.3
Treasure Chest Member  Greenback Member - Level 2 
Mirrors within mirrors.

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Recent posts of same category, on single post pages GeoParadise Atahualpa 3 Wordpress theme 10 Apr 19, 2010 08:54 AM
Category Excluder Sidebar invisible hidden exclude Neil Grayson Forum How-To 1 May 25, 2009 07:02 PM
recent posts in the right sidebar, but not on the home page ind Sidebars & Widgets 1 May 6, 2009 03:49 AM
More! I want more! (recent posts in sidebar) paulae Sidebars & Widgets 0 Apr 9, 2009 08:43 PM
Exclude widgets from sidebar deanw Sidebars & Widgets 1 Mar 19, 2009 12:43 PM


All times are GMT -6. The time now is 08:19 AM.


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