Tip: use shortcodes anywhere

October 15, 2010 | No Comments Yet

Shortcodes are meant to be used for post and page content, but with a little custom code you can make them work elsewhere, as shown in this article:

  • Text Widgets
  • Template Files
  • Comments
  • Excerpts
  • User Descriptions
  • Category, Tag, and Taxonomy Descriptions

I think the most crucial piece of code to remember here is the one for theme files. Just add the line do_shortcode('[foo]'); and that will obey shortcode syntax. Super convenient! Also check out this list of custom shortcodes. For WordPress.com users, there are a bunch of media shortcodes already built in.

See also: how to use widgets anywhere.

Leave a Comment | Tags: , , , , ,

Plugin Readme files now support video

February 23, 2010 | No Comments Yet

A new feature that will benefit WordPress plugin authors and plugin users alike: you can now add video in the readme.txt file of a plugin. This information will be displayed in the WordPress Just like WordPress posts & pages support shortcodes and oEmbed, so do plugin readme files now. There are two ways of doing this: oEmbed, by entering the URL of the video in its own line, and shortcodes, by entering the type of video and the URL in between square brackets, e.g.:

  • [youtube http://www.youtube.com/watch?v=7EiKx_WSesk]
  • [vimeo http://vimeo.com/173714]
  • [wpvideo OO4thna8]

The feature currently supports three video providers: YouTube, Vimeo, and VideoPress. It must also be noted that object embed codes (the usual way of embedding videos on websites) is not supported, just the two methods above. View the test example here.

Leave a Comment | Tags: , , , , , , , , ,

Embed media using only URLs in WordPress 2.9

October 16, 2009 | No Comments Yet

Here’s another great feature coming up in WordPress 2.9: easy media embedding using just the URL of the photo or video you want to place in your blog posts.

The catch is the URLs must be enclosed in shortcodes, and that the media must come from one of the predefined media providers: YouTube, Blip.tv, Flickr, Hulu, Viddler, Qik.com, Revision3, Google Video, PollDaddy, DailyMotion.

Of course, there are methods for adding more providers: using (a) wp_oembed_addprovider() function for oEmbed-compatible website and (b) defining a handler/callback function that checks the URL and generates the necessary embed code in its place.

Finally, wp_expand_dimensions() lets you resize the media to the largest dimensions possible given an example width-height ratio.

Read more about these in Viper007Bond’s post.

Leave a Comment | Tags: , , , , , , , , , ,

WordPress.com lets you post by email

May 15, 2009 | No Comments Yet

Still on the WordPress.com front, there’s a new feature called Post by Email, which does just what it says: it lets you create and publish new posts straight from your email account.

All you have to do is check out the secret email address assigned to you under My Blogs, then send your blog post to it, and watch it show up on your blog. Formatted text and attached images are all detected. In fact, if you upload multiple images, a gallery is created for them!

If this hasn’t whetted your appetite, here’s a quick run-down of Post by Email features:

  • Transcoding of any video files supported by the WordPress video player (mp4, mov, wmv, avi, mpg, and m4v).
  • Automatic removal of standard signature blocks, with support for manual removal of other signatures.
  • Add your email addresses directly into your address book using downloadable vCards. (You don’t even need to remember the address!)
  • Automatic notification of a published email post.
  • Conversion of YouTube URLs into embedded videos.

Also check out the Post by Email support page for advanced features like shortcodes you can use in your email.

I can’t wait to see all of these features on self-hosted WordPress.org blogs. Although blogging by email is already supported, it’s not quite as streamlined as this.

Leave a Comment | Tags: , , , , ,