The following snippet when placed within a WordPress post loop will display a feature image uploaded via your media uploader and place it as a background image within a div tag.
If the desired output of the default WordPress post thumbnail is not enough you can easily adjust the PHP to output your appropriate class. <?php the_post_thumbnail(‘post-thumbnail’, array( ‘class’ => “YOUR CLASS”)); ?> More information can be found on the codex.
With the release of WordPress 3.7 you now can have your plugins and/or themes update happen behind the scenes.
Recently I had a great conversation with an outstanding User Experience designer about a few interactions on a project we were working on. One of the points we talked about was, what should happen when text within input fields are excessively long.
The desired result we both agreed on was to change the font size on the fly. Thankfully this is extremely easy with a little bit of jQuery that listens to events on the input field.
So if you happen to be in the same situation hopefully these snippets should get you heading down the right track.
If you use shortcodes within your WordPress theme you might need to also add them within your widgets. This little snippet does the trick.
Viewing telephone numbers on iOS device can provide an unpleasant shock. They tend to render in a default blue colour making your designs look broken.
If developing themes or plugins for WordPress sometimes it is handy to add a menu item to the WordPress admin bar to help quickly reference the desired action.
You can do various things with the admin bar but this snippet should help you get started.
If you have installed Google Analytics on your site, or for a client it is always helpful to exclude IP addresses so the sites stats give an accurate representation of the real traffic.
Sometimes the light grey placeholder text needs to be styled to fit with your needs. All in all it is pretty easy with a couple of pseudo-elements and pseudo-classes.
If you happen to need to trigger an event when a checkbox is checked or unchecked with YUI then this little snippet should help you out.