Sometimes you want to detect new users on your site versus returning visitors and display different sorts of information to them. An easy way to do this is to set a cookie. Read more
Sometimes you want to detect new users on your site versus returning visitors and display different sorts of information to them. An easy way to do this is to set a cookie. Read more
For my projects on GitHub I like to have the most recent stable version tagged so that people have an easy download link to it. So when I go from versions 0.4 > 0.5 on project (for instance), I do this:
1) Delete the v0.4 tag locally: git tag -d v0.4
2) Delete the v0.4 tag on GitHub (which removes its download link): git push origin :v0.4
3) Add a new tag for the newest stable release: git tag -a v0.5 -m "Version 0.5 Stable"
4) Push the latest tag to GitHub (two dashes): git push --tags
I’ve encountered a couple issues with javascript race conditions this last week, especially in the Chrome browser.
A race condition is where the timing of one event is critically tied to other events which need to happen before it in sequence. In both situations I was enqueing a javascript file, but I also had inline javascript that wouldn’t work until the enqueued file had completely finished loading.
Read more
Premium Pixels is an excellent design resource run Orman Clarke. He publishes slick photoshop files every few days, including this Simple Table design.
For a little challenge I decided to turn his Photoshop file into actual code using CSS3 and a bit of JQuery. You can see a demo here or download the code (feel free to use in your own projects, no attribution necessary).
You can’t assume everyone is running the latest version of WordPress, especially around big point releases.
If you want your code to be backwards compatible (keep it within reason), you can do a simple WordPress version check with conditionals by using:
get_bloginfo('version');
Or just use the global variable $wp_version.
Read more
Updated: 3/19/12
The latest version of this Thematic Options theme has been completely rebuilt to use the Options Framework Plugin. It’s rather basic and has just a couple settings- but if there’s something else you’d like to see in it please file a ticket or send over a pull request on GitHub.
If you’re interested in building options for a theme other than Thematic, please check out the Options Framework Plugin or the Options Theme.
You can download the latest version of the Thematic Options on GitHub.
There’s two ways main ways to display posts on the home page and archive pages in WordPress. The first is to use the_excerpt tag, which checks to see if an excerpt has been manually entered. If it has, WordPress will display it. If it hasn’t, it’ll take the first 55 words from the post and display that instead.
Using the_excerpt is a perfect way to display a tiny snippet of the post so people can easily scroll through all the topics. When using the_excerpt, WordPress will also automatically remove any images or html tags that might mess with the layout in a shortened version.
Read more
I recently updated Portfolio Press to use new icons for its custom post type. The previous icon worked fine, but it didn’t exactly match the rest of WordPress core. I was also lucky enough to have Ben Dunkle, the designer who created the current set of core WordPress icons, offer to make me a new one.
I have a zip file of the icons I used (in psd format) which also has some other options we considered (briefcase, nicer weird eyeball) and the png files of the final choice. Feel free to use this in your own projects that need a portfolio icon. You can download it here.
There’s also a great collection of free custom post type icons available here for download which might have other icons you might be looking for.
Read more
Derek Herman just released OptionTree, a plugin that makes it easy to set up theme options in WordPress. You can easily add uploaders, colorpickers, radio boxes, text inputs, textareas, etc to a panel- and even more advanced stuff like post, tag and page selectors.
The interface as a whole is really nice- similar to GravityForms for the options set up and the WooThemes options panel in terms of actual design. I haven’t dug into the code too much, but it seems well written and commented.
Read more
I’m working on a WordPress theme project where the background needs to change randomly on each page load. To do this I added a body_class that generates a random number between 0 and 5 for me to use for styling (e.g. .random-1, random-2).
Just thought I’d post the snippet in case anyone was looking for something similar:
Read more
There are a number of solutions for rendering “non-standard” web fonts on your site. I was familiar with ones like SIFR and Cufon where it’s recommend to be used only on headers or certain spots of the website. I e-mailed TypeKit to see if it worked the same way, and got this reply from Mandy Brown:
“There’s no file size or speed issue with using Typekit for body text (as there would be with, say, using SIFR or Cufon). That said, you should make sure to use a font that works well at small sizes and renders acceptably cross-browser. Be sure to take a look at the browser screenshots before deciding on a font.”
Oddly, Google failed me on this question, so I thought I’d post it here for anyone else who was curious.
This video tutorial shows how to install WordPress on most any web host that uses cPanel, including BlueHost, InMotion, and HostGator. It shows how to upload the files, edit your wp-config.php file, create a database, create a database user, and then do the actual install.
Read more