Archive Page 3

Enable WordPress Plugin, Theme Updates and Pretty Permalinks on Nginx

WordPress doesn’t know that your Nginx web server is capable of doing URL rewrites without mod_rewrite and Apache, so we explain that by adding:

add_filter('got_rewrite', 'nginx_has_rewrites');
function nginx_has_rewrites() {
	return true;
}

in your theme’s functions.php.

It is very likely that along Nginx you are also running PHP-FPM for all your PHP needs, and for some reason WordPress thinks its PHP process can’t write to disk. We tell WordPress that it can:

add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
	return 'direct';
}

How to Add Simple Google Site Search to Any Website

Built-in search engines of WordPress, Drupal and other content management systems are good, but not as good as Google. Here is a simple way to create a Google search form that will return results only from your site:

<form name="google-search" method="get" action="http://www.google.com/search">
	<input type="hidden" name="sitesearch" value="http://yourdomain.com/" />
	<input name="q" type="text" />
	<input type="submit" name="sa" value="Google" />
</form>

which will look like this:

This form does redirect your visitors to Google, but the results returned are only from your site, so there is nothing to worry about. And with Googling indexing blogs almost instantly, there are actually very little drawbacks from using this approach for site search.

Rewrite WP-Minify URLs for CSS and JS Offloading

If you want to offload your combined and minified javascript and CSS files to a separate domain or a content delivery network (CDN), WP-Minify provides you with a handy set of filters (place this in your theme’s functions.php):

add_filter('wp_minify_js_url', 'offload_minify_js_css');
add_filter('wp_minify_css_url', 'offload_minify_js_css');

function offload_minify_js_css($url) {
	return str_replace('domain.com', 'static.domain.com', $url);
}

Tabbed Widgets Update: Version 1.3.1

Due to differences in the way WordPress handles jQuery and jQuery UI in the current version 3.0.3 and upcoming 3.1, I had to release yet another Tabbed Widgets update which uses a single Javascript file with all the necessary jQuery UI for Tabbed Widgets to function properly.

Tabbed Widgets version 1.3.1 should soon appear in your WordPress updates.

Tabbed Widgets Update: Version 1.3

I have just released an update to my Tabbed Widgets plugin. This version 1.3 adds support for upcoming WordPress 3.1 and fixes all the issues users have previously had with accordion type tabs. It now use Google CDN hosted jQuery UI library and features some performance improvements which should decrease the amount of HTTP requests this plugin requires to function properly.