01.17.2012   |   0comment

Leavitt PartnersLeavitt Partners, in collaboration with Codella Marketing, came to us wanting a fresh start on their out dated corporate site, blog and newsroom. After planning the sites with Mark, Luke worked with Leavitt Partners to solidify the design.

After the design, Tim coded each site. The main corporate site, leavittpartners.com, is built using WordPress and features three Custom Post Types: the slideshow on the homepage, the homepage content and the Team page.

The main Team page is broken up into staff levels but each worker is entered into the system the same way. A checkbox is used to differentiate their level. Also, another checkbox is used to flag if the worker is part of one of the several different sub-teams in the Leavitt Partners corporation. The individual team page highlights the workers accomplishments and also calls in their author RSS feed from the blog as well as any news highlights. continue reading Recent Work: Leavitt Partners”


12.13.2011   |   8comment

Luke, Tuesday Total Textures
When designing websites sometimes a slight texture in the background can create just the right feel. Getting those textures can also be fun. They are all around us. I’ve snapped plenty of close up pictures of dirt, rocks, asphalt, cement, etc. Most of which don’t end up getting used or if they get used it’s quite a ways down the road when it fits with a specific project. The web is another resource for finding textures. One site that has weekly textures is abduzeedo.com. Each Tuesday they post a ‘Total Tuesday Textures’ post. Every so often I grab a texture from their site for safe keeping. Check it out for yourself and post some links of how you have used texture in your design projects.

Tim, Magento Project Guidelines for Designers
Magento is a beast and we all know it, however, TutsPlus comes through again with a great walk through of the basic Magento views. I have been guilty of overlooking the seldom used views, but this guide will walk you through all of them to be sure your design elements are consistent throughout the site. The part I like most about the article though is the FREE PDF download that I highly recommend sending to a client as soon as you can to help educate them about the ins and outs of Magento.

Benjam, New to PHP 5.4: Traits
PHP 5.4 is right around the corner, and one of the new features added to this version are class traits.  I won’t go into too much detail, you can read the blog post for that, but it makes reusable OO code even more reusable by allowing multiple unrelated classes to pull in the same traits from a master trait object.  Like built-in mixins.


Chad,on the topic of  Web Development, WordPress
12.09.2011   |   3comment

The purpose of this post is to help you secure your WordPress self-hosted site by installing and setting up plugins. As of the time of writing this post these plugins have been used with WordPress 3.2.1.

Keeping your site secure or safe from hackers is not always easy but is something you need to be aware of. One thing I encourage you to do just in case your site is compromised is to always have a back up of your files and database. As a start, one plugin that can help with this is named BackWPup ( www.backwpup.com ). You can set this plugin to backup your files and database daily, weekly, monthly, or if you feel even hourly. But you can have it email it to you, save it to another server via FTP, or even save it to your DropBox account.

There are a few steps that you can take from the beginning when you first setup your WordPress site. The first thing to do is do not use the default table alias. WordPress by default will suggest that it use “wp_”. If you are only going to use the database for your site and not add any other tables I would suggest you take it off all together, but to make it even more secure use a different alias. continue reading Securing WordPress with Plugins”


11.29.2011   |   1comment

Trademark Access is a service provided through Bateman IP which is a law firm that specializes in intellectual property and is located in Salt Lake City, Utah. They need a site specifically for Trademarks and this site provides a client an easy way to get started in the Trademark process.

The site is built using a custom WordPress theme with 3 Custom Post Types. The client can easily update the About, Plans & Pricing and Home page. The Custom Post Types allow the client to update their FAQs easily, manage their Testimonials and Expertise sections. continue reading Recent Work: Trademark Access”


11.18.2011   |   0comment

We build several WordPress sites each month and our clients are always asking what plugins they should be using for their new WordPress site. Depending on the functionality of the site, the need for plugins vary. For example, if the client has a blog or plans to have a place for comments, I will always recommend Disqus over Intense Debate and the default WordPress comment system because I think it functions better overall. I like the interface for Disqus much more then any other comment system and they have an Android app that makes it easy for me to moderate comments on the go.

When it comes to site performance, there is only one caching plugin that needs to even be talked about and that is W3 Total Cache. This plugin is so complete that it is shocking. It is packed with features and accounts for every type of WordPress user. It is very easy to configure and it actually works! I run a Lacrosse news website where I recently installed W3 Total Cache. According to the Google Analytics Site Speed metric, from September 17 to October 16, the average load time was 3.47 seconds. From October 17, the day I installed W3 Total Cache, to November 16, the average load time was 2.36 seconds. That is a difference of 1.21 seconds! The plugin also shows your Page Speed Report on your Admin Dashboard so you can see how well your site is performing. Every time I visit the site I am pleased with the results. continue reading Plugins Every WordPress Site Should Have Installed”


Brian,on the topic of  Linux, PHP, Tools, Web Development
11.11.2011   |   2comment

A few times in my career, I’ve had the need to test emailing in one form or another. I’ve also had the unfortunate experience of accidentally sending a test email to a real person. As you can imagine, this may cause confusion, embarrassment, lectures, and possibly the death of a small pixie or two. Fortunately, there IS a preventative measure you can take.

When it comes to mail() (as well as many other things), PHP prefers to delegate the heavy lifting to another piece of software: sendmail (or a sendmail compatible command-line mail transport agent). By default, PHP will call your sendmail binary, and pass it the entire message, after composing it from the headers and body supplied by the developer.

One of the side-benefits to this system is the ability to override PHP’s default, and seamlessly hook in your own sendmail-esque binary or script. My favorite parts of this hack, is that it doesn’t require a recompile of PHP or anything all too complicated, just a small change to your php.ini file. continue reading Sendmail in Development Environment”


Luke,on the topic of  Browsers, JavaScript, WordPress
10.20.2011   |   3comment

We all love CSS3 and the things we can do with it. It is saddening when a client opens up the site you just coded and doesn’t see all the CSS3 goodness because they are using some version of IE. Frequently, CSS3 PIE has saved me from the client saying: “Why don’t the buttons have the rounded corners like your design?”

CSS3 PIE makes some CSS3 features work in IE6 – 9. It supports border-radius, box-shadow, and linear-gradient. It works great and is super easy to set up. Unless you use it in WordPress. After some Google searching, a fair amount of testing, and a lot of grumbling I got it working in a WordPress site. It is really simple. I hope that this will save others from some headache.

1. Put the PIE.htc file in the WP Root directory and then reference it in your css as – behavior: url(“PIE.htc”);
2. All the elements that use CSS3 features will need either position: relative or position: block on them


Benjam,on the topic of  PHP, Usability
06.23.2011   |   0comment

I have a flat MPTT array (really any tree ordered array will work, not necessarily an MPTT array) which has it’s elements output in order as follows:

  • Top Parent 1
  • Child 1-1
  • Child 1-2
  • Sub-Child 1-2-1
  • Sub-Child 1-2-2
  • Child 1-3
  • Top Parent 2
  • Child 2-1

Each element is it’s own entry in the one dimensional array. This makes outputting that data in any kind of readable form very difficult, where keeping track of parents and branches are required in order to make sense of it. This gets pretty messy, pretty quickly. And the deeper the tree, the more complicated the process.

To make this easier to deal with, the array should be built in a tree format as follows:

  • Top Parent 1
    • Child 1-1
    • Child 1-2
      • Sub-Child 1-2-1
      • Sub-Child 1-2-2
    • Child 1-3
  • Top Parent 2
    • Child 2-1

Where the children of the elements in the tree are actually children of the elements in the array.

In order to do this quickly and painlessly, we are going to parse through this array twice… no iterations, just a couple of foreach loops and we’ll get our tree exactly how we want it.

In order to do this, we must first make sure our array indexes are the same as the IDs of the items we are sorting (because we are pulling this from a database, right?).

To do this in CakePHP we run it through the Set::combine function like so:
Set::combine($tree_data, '/Model/id', '/.');

If you are not using CakePHP, you can create a new array, and as you foreach through your original array, set elements in the new array accordingly:

$old_tree_data = $tree_data;
$tree_data = array( );
foreach ($old_tree_data as $node) {
	$tree_data[$node['Model']['id']] = $node;
}

Now that we have our array indexes set to our model ID, we can proceed.

The trick to this method is not to move the nodes around, because if we did that, we’d still have to keep track of what went where, and that’s exactly what we’re trying to avoid. Instead, we’re going to use references to keep track of our data as it gets moved around. That way we still have our original base array element that we can play with without having to know where it actually is in the tree.

Here is the code, and then we’ll go through it and explain.

foreach ($tree_data as $key => $node) {
	if ( ! $node['Model']['parent_id']) {
		continue;
	}

	if ( ! isset($tree_data[$node['Model']['parent_id']]['Child'])) {
		$tree_data[$node['Model']['parent_id']]['Child'] = array( );
	}

	$tree_data[$node['Model']['parent_id']]['Child'][] =& $tree_data[$key];
}

Now to explain… We parse through the array and for each element, we first test the element to see if it has a parent, if it does not, we just skip it, there’s no need to go further.

We then check and see if the parent element has an index called ‘Child’ and if it does not, we create one and set it as an array.

Then we do the magic. We set the next item in the parent node’s Child element to the reference of the current node. We don’t actually move the node. So now if you look at the array, you’ll see two entries for the current node, one inside the parent element, and one that was the original in the flat array.

WARNING: One thing to note here, is that we are not setting it to the reference of $node, but to the reference of $tree_data[$key]. The reason for this is because if the element is referenced to $node, the next time through the loop, all of the referenced elements will also be set to the new value of $node, and we certainly don’t want that.

The magical part of this, is that no matter where the references end up, the original is still there to be modified. So for instance if I have a branch path with IDs as follows: 12, 5, 13, 14… it doesn’t matter what that path is, I can still access the element with ID 14 by modifying $tree_data[14]. So if element 14 has child nodes, I can place them in the tree by modifying $tree_data[14]['Child'], and wherever that node is actually supposed to be, it will get modified there as well. That’s the beauty of references.

Now to clean up the array, we just parse through it once more, and clear out the original reference nodes (the ones that have parents):

foreach ($tree_data as $key => $node) {
	if ( ! empty($tree_data['Model']['parent_id']) {
		unset($tree_data[$key]);
	}
}

And that’s it! No messing around with paths… no iterative functions… just twice through an array (maybe three times), and it’s all sorted, compartmentalized, and pretty.

If you have other methods of getting your trees into a usable form, please let us know in the comments. We love seeing how other people do things.


Tim,on the topic of  Business, Design, Portfolio, WordPress
01.08.2011   |   0comment

Dr. Stoker recently graduated from Dental School and found a home in an office building in Salt Lake City. He needed to build his patient list so he figured a business card website would help get him more patients. Enter Code Greene.

Luke started Dr. Stoker down the right path by giving him a clean, business design. I finished off the job with a custom WordPress theme that allows Dr. Stoker and staff to easily enter in new content and keep the site fresh, just like their patients breath!

Dr. Stokers practice is off and running with great success.

Check out the site and let us know what you think!

SLC Dental Center


Tim,on the topic of  Browsers, CakePHP, PHP, Web Development
09.03.2010   |   0comment

Below are some tweets that I have seen recently that I have found to be helpful.

Smashing Magazine – HTML5/CSS3 Cheatsheet – http://bit.ly/aj0yfA

Ben Ludman – URL shorteners and CakePHP – Snook.ca http://bit.ly/btTmSP

And this site – HTML5 Doctor – I couldn’t track down the tweet that I found it from, but it is a great resource for HTML5.

I looked for some tweets about Magento, but just couldn’t find any that were appealing.