Theming for the Masses
I got plenty of good design and code considerations in this slideshow from Wordcamp Seattle 2011, by Michael Fields. I wish there’s a presentation video somewhere.
I got plenty of good design and code considerations in this slideshow from Wordcamp Seattle 2011, by Michael Fields. I wish there’s a presentation video somewhere.
Not only do the handy internal configuration tools for “quick customization” give clients every opportunity to break their own sites, they carry a lot of overhead. Your CSS files will be bloated as you are always offering the code for two column, three column and six or seven different colours.
The upshot is that these themes are generally not coded for best loading time. They have to include and do so many things (CSS, JS, queries) to cover all the possible combinations due to their huge set of features, every time you open a page, regardless whether you use these features or not!
It’s not that having plenty of features is bad. It’s the inefficiency that can be disadvantageous to the end users.
Some people want to migrate from normal blog to a Multisite but it is indeed seems complicated. So here’s a detailedly written article, with a helpful video.
If you want to display an author’s Gravatar, this little code should do the trick (note that it only works inside the Loop):
<?php echo get_avatar( get_the_author_meta('user_email'), 48 ); ?> |
The second parameter dictates the size of the avatar. More about get_avatar().
I’ve been using this Tutplus tutorial to create custom post types, especially the part about creating custom post input. It works nicely, except for the fact that the meta values entered with that input can get deleted completely by WordPress when it autosaves a post. Or if you Quick Edit a post.
It seems to be a WordPress bug Fortunately, someone posted a fix on the comment area. It’s pretty self-explanatory.
There’s also a Trac ticket discussing it, there you can find a more correct fix involving the use of nonces.
In Settings > Media, you are able to set only the height or width of the Thumbnail images and WordPress will resize them proportionally (i.e.: if you have a fixed height, then the widths will vary depending on your uploaded image dimension, and vice versa).
Inside the loop, you can get a thumbnail’s width, height and URL using this code:
$imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); $imgurl = $imgdata[0]; // the url of the thumbnail picture $imgwidth = $imgdata[1]; // thumbnail's width $imgheight = $imgdata[2]; // thumbnail's height |
For the second parameter of the wp_get_attachment_image_src function you can also use ‘medium’, ‘large’ and ‘full’. They correspond to the dimension for the other sizes in Settings > Media.
A tutorial on adding description to your WordPress 3.0 menu links. Might be a nice update for Pico.
Ghost, Rethinking WordPress. Also don’t miss the discussion over at Hacker News.
For The Aspiring Professional WordPress Developer is a collection of good advices for those wanting to be a WordPress pro.
Recently I had the task of cloning a WordPress site both to my local server and to another development server that I host. The Duplicator plugin has been a massive help for me, makes cloning really simple and fast. Highly recommended.
Eric Mann uses classes in his non object-oriented WordPress code. Here’s why.
This great article could be useful if for some reason you have a need to filter the_content in your theme.
New post from the Search Engine Roundtable: Someone “…received a response from Google to a reconsideration request that the only way his site will be reincluded in Google is if he removes all or most of the links in those WordPress themes.” The problem is that those links are in the form of sponsored links on footer (a practice I saw a lot in the past, not so much in the present).
I don’t think it will be easy, or even possible, to do what Google requested. If a theme contains an upgrade notification feature it might be possible to do, but even then the users might choose not to upgrade.
Secondly, if this is true, I wonder whether Google differentiates between credit links (“Designed by…”) and sponsored links. I would say they should, but then again I’m not a SEO guy.
New favorite blog: Theme Options Gallery by Konstantin Kovshenin, discussing “the best (and the worst) theme options screens around”. Loving the in-depth article and discussions already available there.
Pretty safe to say that if it shows up on A List Apart, it’s going to be the de facto standard. Time to learn some Foundation.
Couple of days ago we got Starbucks’ style guide, and now here’s another by Google. I think the interesting thing is the rule to “\[o\]mit the protocol from embedded resources“. So instead of typing <script src="http://www.google.com/js/gweb/analytics/autotrack.js"></script>, they recommend to type <script src="//www.google.com/js/gweb/analytics/autotrack.js"></script> instead (without the http part). Never heard of that before.
Robb Shecter’s WordPress site got popular overnight thanks to Reddit and went down immediately. The interesting aspect is that the site was new and it’s on a relatively high-powered server. The author then found that the theme he used in particular was doing too many (47!) server requests at a time, and the site ran along very well after switching back to Twenty Eleven.
I think it’s an important read for any theme developers out there.
A superbly detailed article, part one of a series about web development toolchain.
I’ve always been on the hunt for that perfect syntax highlighter plugin. Currently I’m using WP-Syntax, which does its job very well. However I’ve just found this plugin called Crayon Syntax Highlighter, which could be a good contender for the best WordPress syntax highlighter plugin out there.
It looks good, and I like the little toolbar on top of the code box, with the small icons. Additionally, it also offers a lot of customization options. Lastly, it seems to support the same pre tags to wrap the code, similar WP-Syntax, so if I do make the switch, my old codes will still be highlighted correctly.
A nice little web app that shows you know what theme is used by a WordPress-powered site.
The Starbuck website has its own style guide, accessible for public. I think its a neat idea, wouldn’t it be cool if themes have their own style guide? Pretty sure it will be helpful both to users or developers alike, if time consuming to write.
Also, I wonder what they use for the various toggles panel on the top right corner like on this page. It shows background, baseline, boxes, can be used to change windows size as well. Looks like it’s custom coded, imagine how super useful it can be if it’s a jQuery plugin.
I love theme options frameworks. And I want you guys to check this new framework called NHP. It passes my “does its UI look like the rest of WordPress enough?” test (screenshots here), it has tons of field types, and even offer validations, too.
Can’t wait to test and probably use it too in my to-be-released theme hint hint
This post at Dev4Press outlines what MillaN, its author, thinks would be a necessary addition to WordPress.
Based on the comments, it appears that a lot of people agree with this list. Some of the items mentioned can be achieved with plugins (e.g Tax Meta Class to add meta data to taxonomy items, Custom Post Types Relationships for, well, creating custom post type relationships), so expect there to be a bunch of debates about what should and shouldn’t go to the core.
I like his list, but I disagree with his assessment that we don’t need new core themes. We do, especially to bring about the standard for how a theme options should be designed. This is the aspect that desperately needs to be standardized. Different theme companies and individual theme designers have their own idea of how the theme option UI should look, and it’s hurting the users.
With CSS 3, vertical centering is as easy as this. It uses a new display mode called flexbox (super detailed working draft on it here).
I recently spotted this interesting Ask Metafilter thread where user gd779 tries to find a way to upgrade his old, WordPress 1.5 install. One of the answer is pretty detailed:
I think the right approach is going to be:
- Do a full backup of your WordPress files
- Do a full database backup (mysql dump using phpMyAdmin or similar)
Then, from your 1.5.2 install:
- Upgrade to 2.0
- Upgrade to 2.5.1
- Upgrade to 3.0
- Upgrade to 3.3.1
It is quite fascinating thinking about the solution to this. There’s an official Codex page called Updating WordPress, but it doesn’t seem to go that far back in time.
Siobhan McKeown wrote this awesome, birds-eye view of the whole WordPress economy. Make sure to read this two-part article so you know what’s up with WordPress and identify what opportunity lies ahead.
I agree with Matt’s prediction on that article:
I think the next big opportunity is around agencies and consulting—there will be five to six companies as large as Automattic, just providing high-end consulting and services to the large customers who are adopting WordPress en masse.
The one issue with creating responsive web design is in displaying images, especially getting the most appropriate size in a particular screen size. One solution for it is the Responsive-Enhance jQuery plugin. It works by loading small-sized images by default, then checks the screen size and loads the bigger version if necessary.
According to its creator, Josh Emerson:
This results in a faster perceived page load speed, but a slower actual speed. I’m happy with this solution as I care more about perceived speed than actual speed.
This tutorial by Keir Whitaker takes the whole thing further by teaching us how to apply Responsive-Enhance in WordPress.