Monthly archives: March 2010
A useful tool to have in in your WordPress toolbelt is the ability to quickly and easily search for, find, and replace specific strings of text directly from the MySQL database. We can do this by entering SQL queries either directly or through one of those handy interface applications like phpMyAdmin, which seems like one of the most prevalent PHP applications on servers today.
Turn regular datestamps into more human-readable text (e.g. 22 minutes ago) via a built-in WordPress function.
Still confused about these "custom post types"? We already have categories for Posts and we can use various techniques like post_class to target certain posts with CSS and do different styling. We can also use conditionals to treat posts in different categories completely differently. Why is this going to help?
The big difference is that it actually adds sidebar links to the Admin side specifically for these new types. And beyond that, you can actually declare custom data types for different types. Instead of just "Add Post" and "Add Page", you can have "Add Real Estate Listing", which only will ask for "Property Name", "Description", "Price", and "Sale Status". Powerful stuff!
A while back we talked about upgrading plugins. Specifically the All-in-One SEO pack and the controversy surrounding how it turns it self off after (some) updates. This is what that plugin looks like when it needs an updating:
I just got my hands on issue #199 of .net Mag. I did an article for it on WordPress, and it's on the cover!
They did use the wrong W for the cover, but I'm sure they got enough flack for it they won't mess that up again =). This is probably practically an old issue for UK folks, but big bookstores in the U.S. I find do tend to stock this magazine (Sold as "Practical Web Design" in the U.S.) but always a few issues old, so I bet you could find it around about now.
Editor's note: 404 link removed.
When designing WordPress themes, I always add a common set of custom functions to the theme’s
functions.php file. This speeds up development time because I don’t have to hunt for and individually copy the same slew of functions for every theme. I just drop in a copy of my functions.php template and build up from there. This takes care of all those little things that always need to be done for every theme. You know, things like:
Have a bunch of different areas you wish to declare as a widgetized area? Save repetative code by creating a quick array of their names, then loop through that array calling the register_sidebar() function on each one. Elementary PHP stuff here, but hey, it just saved me quite a few lines of code in a widget-heavy theme I am working on.
Drag to your bookmarks bar, click, get a bunch of buttons for easy access to specific areas of your WordPress admin. No security concerns, other than taking people to your log in page, so assuming you have a good strong password you are fine. Also I suppose this assumes you have WP installed at the root...
WordPress has a bunch of AJAX abilities built in that you can access, without having to use any outside resources. Gary Cao shows how, pointing out good and bad practices.
Editor's note: 404 link removed.
Most blogs display their post content in single columns, like what we do here at Digging Into WordPress. But you know it’s also possible to display post content in multiple columns. Multiple-column layouts are perfect for newspaper and magazine-style themes. This DigWP article presents six ways of getting the job done using a variety of techniques, tricks, and tips.
The post_class() function in WordPress is pretty darn useful. It is used like this, in most templates, in a wrapping div of all the content you are outputting:
Marcus Neto attempts to compares the two CMSs while explaining why he likes ExpressionEngine. Are they really apples or oranges? I suppose you could say that. Apples and oranges are both popular spherical fruit. They have more in common than theyhave different. Same with the two CMSs.
While I'm 98% a WordPress guy, there are a few circumstances I might take the EE route, like when:
- I knew I was going to need a whole bunch of different custom data types and groups and didn't feel like dealing with the whole Pods or Flutter setup.
- I also knew no newbie client was going to need to get in there.
I had occasion the other day to run a shortcode inside of a text widget. You know shortcodes... we talk about them all the time. They are keywords in
[square_brackets] that do something special.
Sometimes they do something really simple like return a string (so you can have a global location to customize some string of text, for example), or they do something more complicated like call a plugin that does something fancy like build a photo gallery.
Getting your plugins listed in the official WordPress Plugin Directory is considered a chore by many, but it's nothing that should stop you from sharing your plugin with the community at large. Up until now, I haven’t really bothered with adding my plugin collection to the Directory, but after Herb Goodman helped to package my recent Block Bad Queries plugin, I figured now was a good time to dig in and learn the ropes. It turns out the process only took about an hour to complete, not including the waiting period for access to the Subversion Repository (which was about 18 hours). Definitely worth the potential exposure provided by having your plugin listed in the official directory.