Someone at the WordPress StackExchange site was wondering how you could display a list of a page’s ancestors. Pretty much that is the idea of breadcrumbs, so I answered his question using the handy get_ancestors() function.
Convert your post’s custom fields into tags automatically in WordPress with this nifty script!!!
Here’s how to enable the “excerpt” box for your WordPress pages.
Here’s a new tiny function that will help you run PHP code in WordPress only when you (or other admin-level users) are logged in.
That’s right, you CAN’T!
Serializing arrays in PHP is a great way to format their content before storing it in a database. However, if the serialized content has certain characters (such as “;” or “:”) the resulting string won’t be read correctly by the unserialize() function, which is a huge bummer. So, here’s a workaround. http://davidwalsh.name/php-serialize-unserialize-issues Be Sociable, Share! Tweet
Let’s say you want to server-side detect whether a user’s browser is the dreaded IE6 using PHP (instead of on the client side, which is usually done with conditional comments). Here’s how.
When developing for WordPress, sometimes you may need to create a PHP script that will automatically login a user so you can enable user functions. The WorpPress function wp_singon() is the perfect solution.
When programming for WordPress, sometimes you may need to get the ID of the last post that was inserted to the database (à la MySQL’s ‘LAST_INSERT_ID’). Here’s the thing: the wp_insert_post() function returns the newly inserted post’s ID, so you can use it to perform more stuff on the post right away, without having to mess around with any SQL commands to retrieve it. Clever, huh?