Published January 03, 2011 · Filed under ,

I added a new sidenotes feature to the site inspired by the blog of the WordPress founder Matt Mullenweg (and countless other blogs). This feature allows me to post mini-entries that are somewhere between a real entry and a twitter post. I tried using several plugins including AsideShop and Miniposts, but none of them really worked with my blog or interfered with other features of the site. Finally I stumbled on Adding Asides in WordPress’ own codex and found it tremendously helpful. After implementing the code, one little feature I wanted to have was the ability to exclude these sidenotes from the main posts’ Archives. I use a plugin called clean Archives reloaded, so I added the following code:

1
$rawposts = get_posts( 'numberposts=-1&category=-CATEGORYTOBEEXCLUDED' );

below this line

1
$rawposts = $wpdb->get_results( "SELECT ID, post_date, post_date_gmt, comment_status, comment_count FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND post_password = ''" );

Replacing of course ‘CATEGORYTOBEEXCLUDED‘ with the ID number for the specific category that I wanted excluded. Adding the second line in there is kind of redundant, but the plugin uses a direct query instead of get_posts() for memory reasons and I didn’t want to mess with it.

Print / Save / Share this post:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Balatarin
Permanent linkMarzieh Ghiasi


No responses yet

Leave a Reply