Carton Premium Theme for WordPress

carton theme sml

Carton is a HTML5 premium theme for WordPress built using David DeSandro’s jQuery Masonry plugin. That means all of your posts will align perfectly into a responsive grid layout, so that your site will look great on a desktop, tablet or handheld device. Plus, there’s no need for pagination since all pages use Ajax and […]

Better Way to Resize Video using jQuery

videoresizer

I have already written a little jQuery snippet to resize videos but I came across an article by Chris Coyier with an approach that I thought worked a lot better. Though I did add a few tweaks to it: Now your videos will only be resized if they are larger than the parent container. In […]

Trim Characters using PHP

short

I had previously written about how you can easily trim your text using a build in WordPress function called wp_trim_words() but sometimes you actually want to trim your text to a specific number of characters as opposed to actual words. Here is a short function that will do just that. If you want to use […]

Convert Pre Tag Contents to HTML Entities in WordPress.

pretag 2

When I was working on the Gridiculous responsive grid boilerplate and putting together the site, I wanted to create an easy way to add a syntax highlighter for my code snippets. I decided to use the Google Prettify syntax highlighter since it was lightweight and super easy to install. The only problem was actually adding […]

Gridiculous for WordPress

gridiculous sml 2

I’ve been working on a WordPress theme for my Gridiculous boilerplate for quite a while and I’m finally finished. I submitted it to WordPress.org but it usually takes them a while to approve a theme and put it live so for now I’m going to post the download link below Here are a few of […]

Using the Ternary Operator in PHP

ternary

It took me a while to actually figure out the name of this type of operator since trying to search “PHP” and “question mark” didn’t really result in anything useful. You’ve probably seen the ternary operator used multiple times in code and just never really understood what it was and how it worked. All it […]

Add a Copyright Field to the Media Uploader in WordPress

copyright field

When you upload something into WordPress using the Media Uploader, you can include information such as a caption or a description. If you wanted to include something else, you would first have to create a custom field by hooking into the attachment_fields_to_edit filter. I decided to add a “Copyright” field so that I could credit […]

Gather Post Stats from Twitter and Facebook

twitter facebook2

If you’ve included any social buttons on your site, such as the Facebook like button, you can usually see how many people have clicked on it. It’s all done through JavaScript but you can also retrieve that number using PHP. Facebook has the Graph API and Twitter offers a similar API. Let’s do a quick […]

Trim Your Text with wp_trim_words() in WordPress

trimwords

When I first started putting out Premium themes for WordPress, I create a custom excerpt function that would trim your post content to a certain number of words. Today, I discovered that WordPress 3.3 actually has a similar core function called wp_trim_words(). The function works like so: The parameter break down: $text (string) (required) Text […]

A Better wp_link_pages() for WordPress

betterpages

If you’ve written a long post, WordPress provides the <!–nextpage–> quicktag so you can divide it into multiple pages. All you need to do is make sure that the theme you are using has included the wp_link_pages() function somewhere in the single post/page template. The function works perfectly, except when it comes to wanting to […]