Genius is nothing but great effort applied. – Awa Kenzo

Give WordPress Posts an Even-Odd Class

If you’re rolling your own WordPress loop(s), then this trick comes in handy when you build a “grid loop”. A grid loop has post teasers side-by-side in a column.

<?php if (have_posts()) : while (have_posts()) : the_post();?>
   <div id="post-<?php the_ID(); ?>" <?php $even_odd = (++$j % 2 == 0) ? 'even-post' : 'odd-post'; post_class( $even_odd ); ?>
      <p><?php the_excerpt(); ?><>
   </div>
<?php endwhile; endif; ?>

Then in your CSS:

.odd-post {
	clear: both;
}

Using GitHub – a quick, no nonsense guide

GitHub Logo

The following commands are basically notes to myself. I’m frustrated by the abundance of Git tutorials that speak in tongues.  I’m your average Web Developer with some PHP and CSS knowledge. I use these commands to manage a few repositories on GitHub.com. It’s taken me months to learn what you are about to read; so here you go – in plain English! [Continue reading]

How To: Add Social Media Icons to Genesis (without a plug in)

social-media-icons-to-genesis
If you’ve followed my blog at all, you’ll know I despise using unnecessary plug ins when you can code a lighter version by hand. This handy function creates some simple sharing icons to insert into WordPress blog posts. (See the example below this post).

The following will add the Facebook, Twitter, Google Plus, Pinterest, StumbleUpon, and LinkedIn horizontal icons above each post. [Continue reading]

How To: Display and Highlight Code in WordPress (without a plug-in)

No need to install a plug in to display and highlight code in WordPress. Although some plug ins offer added functionality (like one click copy/paste), at the end of the day – you’re installing yet another plug in for something you can do with a few lines of CSS. [Continue reading]