Shortcode to add or remove post content from the WordPress RSS feed

I am working on a WordPress podcast site that uses a shortcode to display the mp3 player in the content area. This normally isn’t that big of a deal, but the shortcode was causing the atypical player code to show up in the feed itself, resulting in weird media inclusions from the player, and causing the podcast description in iTunes to break entirely.

Boo, crappy feed.

The solution I found was adding this code to your functions.php file:

function bd_shortcode_killinfeed( $atts, $content ) {

if ( ! is_feed() )
return apply_filters( ‘the_content’, $content );

return ”;

}
add_shortcode( ‘killinfeed’, ‘bd_shortcode_killinfeed’ );

Once you add that, all you need to do is wrap whatever content you don’t want in the feed in [killinfeed] tags. Once you do that, your problems disappear. From your feed.

Yay, fixed feed!

The cool part is that this code totally works in reverse. Say you want to encourage people to subscribe to your RSS feed, and as an incentive, you tell them that there’s exclusive content in posts on the feed. Add this code to your functions.php file, and you’ll now have a shortcode [addtofeed] that will publish content exclusively to your feed, and vanish on your blog.

function bd_shortcode_addtofeed( $atts, $content ) {

if ( is_feed() )
return apply_filters( ‘the_content’, $content );

return ”;

}
add_shortcode( ‘addtofeed’, ‘bd_shortcode_killinfeed’ );

Easy as pie. This is based on the code posted by Jason from DesignPX. Thanks dude!

Grilled Fruit Tacos

Grilling is awesome. Fruit is also awesome. Tacos are inherently awesome. Smash them together and you’ll have a great summer dessert that’s not only delicious, but looks really fancy and impressive. Lucky for us, it’s simple.

Ingredients

  • Fruit. Pineapples and peaches are classic grilling fruits, but I discovered apples to amazingly well. You can grill pretty much anything that isn’t too watery, and if you want to grill little chunky fruits, like strawberries or cut up melon, have some skewers ready.
  • 16 oz ricotta cheese
  • 8 ox whipped cream cheese
  • A liquid sweetener. Honey, molasses, agave, Karo, even simple syrup is fine here. You can also substitute artificial sweetener if you really want. Granulated sugar need not apply.
  • corn tortillas
  • cooking oil
  • granulated sugar (yes, I know what I just said)
  • salt
  • garam masala spice powder

Sweet Ricotta Spread

Let your cream cheese and ricotta come to room temperature, then combine them with a couple of tablespoons of honey, to taste, but don’t make it too sweet. Stir it thoroughly, and refrigerate.

Spice Mix

1 part salt, 1 part sugar, 3 parts garam masala, more or less. You won’t need a huge quantity of this stuff, so don’t go crazy.

Directions

Time to fire up the grill and get your fruit ready. The bigger your fruit stays, the easier it’ll be to move around on the grill and the more forgiving it’ll be in cooking time. (example) Smear a little oil on your fruit, sprinkle with your prepared spice mix, and slap it on the grill.

How long should you cook it? You’ll be about halfway done when the scent starts attracting curious bystanders, but overall it’ll be 15-20 minutes, depending on the phase of the moon and heat of your grill and whatnot. You’re looking for soft, hot fruit, attractive grill marks on all sides, and an overall golden brown deliciousness. While you’re there, grill your tortillas.

Once everything is cooked, slice up your fruit into little manageable pieces, smear a dollop of the ricotta spread on a tortilla, load up some fruit, and serve it forth.

Sadly, I have no photos of the final product, because people were too busy shoving it in their faces. Which isn’t really that sad, if you think about it.

“Good Will” by J.T. Ignatius McNeill


Deprecated: Function get_magic_quotes_gpc() is deprecated in /home1/meredjf0/public_html/wp-includes/formatting.php on line 4387

This holiday season, we’ll be serving up a cup of “Good Will” by J.T. Ignatius McNeill.

Sometimes, we learn about the spirit of Christmas from the most unexpected place.

J.E. Ignatius McNeill is a laptop wrangler in Raleigh, NC who spends the better part of his free time daydreaming about robots that fall in love and aliens who are allergic to milk. You can find out more about him at  twitter.com/dreamrock.


Deprecated: Function get_magic_quotes_gpc() is deprecated in /home1/meredjf0/public_html/wp-includes/formatting.php on line 4387