Latest Posts

Sunday with Beethoven

Egīls Pārups (parups.com) running a child theme of Portfolio Racer

Parups.com is the very first website running a child theme of Portfolio Racer. The following plugins are helping out behind the scenes — Google XML Sitemaps, Infinite Scroll, Page Menu Editor, postMash (Filter), Top Level Categories, Widget Context and WP Super Cache.

Open source rocks!

Smarter Cleaner Gallery

Justin Tadlock’s Cleaner Gallery plugin fixes the semantics of the WordPress built-in gallery feature by placing all of the gallery related CSS in an external file instead of the inline CSS produced by WordPress core.

However, the problem is that this CSS file is loaded on every page request. Therefore, until WordPress supports combining all CSS files into one, here is a quick way to hide this CSS file on all pages that don’t contain a gallery (line 128 of cleaner-gallery.php):

Note: this will add cleaner-gallery.css only on single post and page views (not indexes or archives).

add_action('wp_head', 'cleaner_gallery_head', 0);
function cleaner_gallery_head() {
	global $post;
	if (strstr($post->post_content, '[gallery'))
		wp_enqueue_style( 'cleaner-gallery', CLEANER_GALLERY_URL . '/cleaner-gallery.css', false, 0.7, 'all' );
}

Hopefully, Justin can incorporate this into the next release of this handy plugin.

Google humor: page speed suggestion

Google's suggestions to Google

Web Infinity

Web has that enormous feeling of infinity — every word and though never lost or erased once it’s up there on the web. Incredible, isn’t it, that feeling of never loosing something you hold dear.

Automatically Escape HTML Entities of Code Fragments in Comments

Update: Ryan has made this into a plugin — Code Comments.

Add this to your theme’s functions.php to allow readers post fragments of code in their comments (wrapped in <code>...</code>) which are automatically encoded (think of < and &lt;)

add_filter('pre_comment_content', 'encode_code_in_comment');

function encode_code_in_comment($source) {
  $encoded = preg_replace_callback('/<code>(.*?)<\/code>/ims',
  create_function(
    '$matches',
    '$matches[1] = preg_replace(
        array("/^[\r|\n]+/i", "/[\r|\n]+$/i"), "",
        $matches[1]);
      return "<code>" . htmlentities($matches[1]) . "</code>";'
  ),
  $source);

  if ($encoded)
    return $encoded;
  else
    return $source;
}

Worth noting:

  • Everything wrapped in <code>...</code> is encoded.
  • Line breaks after opening <code> and before closing </code> are removed in order to avoid unnecessary <br /> tags.

Semantics of Article Headline and Byline

Can you think of any reason why placing article credits before the headline, like this:

<p>August 18, 2009 by Author Name</p>
<h1>Title of the Post</h1>
<p>Post body goes here.</p>

is semantically worse than moving credits after the title:

<h1>Title of the Post</h1>
<p>August 18, 2009 by Author Name</p>
<p>Post body goes here.</p>

Tabbed Widgets 0.83

Tabbed Widgets plugin has been updated — fixed default javascript variables.

Tabbed Widgets Updated for WordPress 2.8

I found the time to update one of my most popular plugins — Tabbed Widgets. Test it (version 0.81) and report your findings at WordPress support forum.

Your support and donations are much appreciated and encourage further updates and development.

Pāri jumtiem lido kaijas

by Ainars Mielavs.

Multiple Galleries per Post/Page

Ever wanted to have multiple galleries on the same post or page? Currently most of the solutions require you to manually edit gallery shortcode and add something like include="img_id_1 img_id2". Luckily, WordPress 2.9 will have this include/exclude feature built in core, but you still don’t have an easy way to select images which to include or to insert multiple galleries.

Therefore, I created a plugin called Multiple Galleries which adds checkboxes next to images in the Insert Gallery window which makes selecting images to be included in galleries fast and easy. If no checkbox is selected, all images are included.

Select images which to include in gallery

I created this plugin because I am designing a new WordPress theme for designers, artists, architects and all of the creative types where the ability to have multiple galleries per portfolio entry is very important.

The Pricey GPL Thought Experiment

Let’s create the most expensive GPL licensed WordPress plugin and call it the Pricey GPL. It is offered as a free download from WordPress.org and by default it displays a random paragraph from the most downloaded book at Project Gutenberg in the WordPress dashboard. Of course, there is a widget available, too.

However, to enjoy the real value of the Pricey GPL, you have to purchase a monthly subscription to the PriceyGPL.com service (an API key) which displays a random paragraph from one of the GPL licenses. Read more »

Basic Math of GPL

Khoi Vinh together with Allan Cole have released (a rather noisy) grid based WordPress theme called Basic Math.

They say it’s GPL, while the price tag reads: Single-site License (Limited time only) $45″, which clearly violates one of the main freedoms protected by GPLthe freedom to run the program, for any purpose (freedom 0).

Update: Basic Math is now fully GPL.

Automatic Updates for Developer Hosted Themes

I just realized that the automatic update thing also works for themes hosted outside of wordpress.org.

Enable Automatic Updates for Plugins Hosted by Developers

Currently WordPress doesn’t offer an easy way for plugins which are not hosted on wordpress.org to use its built-in automatic update feature.

Fortunately, I have found a quick and simple way to add this functionality to any plugin and allow plugin authors to take a complete control over when and how the updates are released. Read more »

US Stimulus Package: $2588 to Every American

The US Government stimulus package of 787 billion US dollars ($787,000,000,000) divided by the US population of 304,059,724 equals to $2,588 for every American.

Signs which some economists currently call showing recovery are actually signs of increasing amounts of money being poured into the economy. The economy will be on its way of recovery only when Americans will have repayed this loan and generated some additional return on this investment. Read more »

Perfumes Named After Their Month of Release

Idea for branding: perfume named after its month of release

Because content is king also in the business of perfumes. Inspired by Ubuntu Linux release cycle.

Education, Creativity and Individuality

TED Talk by Sir Ken Robinson on importance of education and creativity (via a comment at swissmiss)

WhiteHouse.gov Runs Drupal

White House opens Web site programming to public. Another proof that Free Software matters. (via WordPress Tavern Forum)

Concatenate Javascript and CSS Files with WP Minify

Minimizing the number of HTTP requests is one of the easiest ways to make your website load significantly faster. WP Minify is a WordPress plugin by Thaya Kareeson that combines all Javascript and CSS files into one respective file.

WP Minfy uses the old trick of modifying the output buffer before it is sent to the user. And until all plugins and themes start using wp_enqueue_script and wp_enqueue_style, this will remain the most reliable method of doing it.

I approve this plugin.

About the Author

Photo of Kaspars Kaspars is a racecar engineer and a web designer living in Latvia and working on the web since 2000. Read more or get in touch.

Es vienmēr tevi mīlēšu, Sirsniņ!