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.
Monthly archives: March 2010
Turn regular datestamps into more human-readable text (e.g. 22 minutes ago) via a built-in WordPress function.
Update 2014/02/08: 404 link removed: http://www.upthemes.com/2010/03/wordpress-master-tip-display-time-ago-for-posts-or-comments/
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.
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:
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.
Update: (404 link removed 2013/11/20)
Most blogs display their content in single columns, but it’s also possible to display content in multiple columns. Multiple-column layouts are perfect for newspaper and magazine-style themes. Here are six ways of getting the job done.
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.