I wrote before that I’ve been running some experiments with Varnish lately. Not that I have huge traffic here but I’ve always used my own website to test things out. As I wrote earlier, the problem with WordPress and Varnish is that WordPress relies on cookies which create cache misses on Varnish and in that previous post I shared a snippet on how to strip all incoming and outgoing...
Attachments Filename and Directory in WordPress
I was trying to figure out how to get the absolute directory of an attachment post in WordPress. Turns out there’s no easy function that can give you one, but there is one called wp_upload_dir which will give you an array of the upload directories and URLs. So here’s the secret sauce: $url = wp_get_attachment_url( $post_ID ); $uploads = wp_upload_dir(); $file_path = str_replace(...
My website is now super-fast with Varnish
My website is now super-fast with Varnish — an open source HTTP accelerator which sits on top of your HTTP servers and serves your cached pages. It didn’t take me longer than 20 minutes to get Varnish up and running on my Ubuntu VPS, and a few more minutes to set all my nginx configurations to port 8080, bringing Varnish to port 80. The problem with WordPress however, is that it...
Selective Page Hierarchy for wp_list_pages
Check out Selective Page Hierarchy for wp_list_pages() where Michael Fields shows how he extended the WordPress Walker_Page class to create a selective “drilldown” page walker, which can then be used with wp_list_pages.
PayPal Default Merchant Language Settings
Note to self. If your PayPal button is directing your visitors to a non-English website (probably because your account was set up in a different country) you can override the language setting with an lc key in the PayPal button form, like this: <input type="hidden" name="lc" value="US" /> This will make sure that the checkout page is in English. Read more about HTML Variables for Website...
Git Archive for WordPress Themes
Quick tip! If you’re using Git when developing WordPress themes and would like to create a clean “export” of the theme that would be installable from the WordPress admin interface and accepted to the WordPress.org themes directory, you can use the git archive command for that with some special arguments: git archive --format zip --output /path/to/themename-1.1.zip ...
Artiste by Orman Clark
Artiste by Orman Clark is a very nice looking portfolio theme for WordPress released today. Just like the rest of Orman’s themes, this one’s got a bunch of options, widgets, shortcodes and templates as well as a layered PSD for heavy customization. Doesn’t seem like it responds to media queries but the layout is flexible enough to fit an portrait iPad.
What are the most exciting features in WordPress 3.3
Question! With WordPress 3.3 just around the corner, we’re all interested in what are the most exciting features in the upcoming core update? Vote and feel free to add your own choices to the poll. My vote goes for permalinks performance and feature pointers.
Abundance: eCommerce WordPress Theme by Kriesi
Kriesi, one of the top authors on Themeforest has released his first eCommerce theme called Abundance. Quite experimental but the sales figures are looking good so far. Thinking of giving it a spin very soon.
Don’t Create a Quote Shortcode
Don’t create a “quote” shortcode when the HTML “blockquote” tag does a perfectly good job. I’ve seen themes that have shortcodes for quotes, citations and headers but no support for the same styling with HTML tags.
Sawyer Hollenshead on Building WordPress Themes You Can Sell