Stuff I've written that probably only interests me
Capture all subcats in a category dynamically
I’ve been working on two foreign language sites where they’re using a category of “English” (slug of “en”) to create an alternate page for English posts. In order to make certain elements on the category pages and single pages in the subcategories of “English” different than those on the pages in the native language, I had to write some code to dynamically pull in all of the subcategories of “English”.
<?php $en = “229″; // used the ID, not slug or name just in case they want to eventually rename the category
$i = 1; // place holder variable
$sub_cats = get_categories(‘child_of=’.$en.’&style=none&hide_empty=0′); // get all children and store in array
foreach($sub_cats as $sub) { // go through all of the sub categories
$english_cats[$i] = $sub->cat_ID; // go through the array and just pull out the category IDs and store in new array
$i++; // go to the nextarray element
WordPress Post Preview
Of late I’ve been working on a new WordPress theme for Ogilvy that will be used as templatized version of their newly redesigned homepage. We already have three different local agency offices that are going to be implementing the theme once it’s finished.
The newly designed company homepage works as a tag cloud that pulls in RSS feeds from throughout our network. One of the features that we’ve adapted for these local sites that the Home page for all of these will just contain the titles of the most recent posts. I’ve developed some really cool code within WordPress that allows you to see a preview of the post that you’re hovering over. The feature is very nice on this site, as there’s no actual article copy visible before you click into the post.
New Blog Design
Decided to install WordPress in the root directory. Hopefully I can keep this ball rolling and finally get my own website up.
