Press "Enter" to skip to content

Category: WordPress

How to add background videos to your WordPress posts

Gasp! This is really cool, guys! How to add background videos to your WordPress Posts @ wpmudev.org. It involves a plugin for shortcode usage, and…

Leave a Comment

How to Add Counter Classes with a Global Variable

Ever wonder how to add counter/numbered classes to your posts? Is this the fourth post or the seventh? Well, if you have wished upon a star (or even if you didn’t, but it was more like cursing out your computer, that’s fine too), then your wish is about to come true with this tutorial.

In this tutorial’s example, we want our blog posts to have classes like “article-number”, and we can achieve this using the post_class(); function and a counter that we’ll set as a global variable.

It’s not as hard as you think. Also, keep in mind that this is a technique that can be applied to other scenarios too, and it’s not limited to just adding classes to our blog posts. Well, let’s get started, shall we?

Before we begin:

  1. Some familiarity with loops and general PHP will help.
  2. Might want to review what variables are. I also go over variables with better analogies in an old article of mine on the Pixafy Blog: Understanding WordPress’ $args Variable
  3. Make sure you have a theme that you can edit files in – for my example, I’m using TwentyThirteen. The files I’ll be working in are: functions.php, index.php, and content.php.

What we’re going to achieve:

global-results

Leave a Comment

Underscores: A Starter Theme for WordPress

I love it when I discover cool new sites! It’s a theme meant for hacking and learning to build themes – have at it! http://underscores.me/

Leave a Comment

Required WordPress Theme Files vs “Required”

The Required WordPress Theme Files

There are only 2 files that are actually required in a WordPress theme for it to be detected and applicable in WordPress. Those 2 files are style.css and index.php.

And then there are those “unsaid” files – those “secret” requirements that become the scuttlebutt amongst developers and are the difference between a good quality theme or “What noob built this thing?!”

So how far do you go? Aside from the required WordPress theme files, what files should actually be present in a theme regardless of whether they’re literally required and why? Well I’ve gone through a fair share of WordPress builds, and I’d like to share my thoughts on that.

3 Comments

How to Change Admin Labels in WordPress

This is a neat trick to know about. 🙂 How to change admin labels in WordPress @ blog.iamcreative. This can come in handy if you’re using…

Leave a Comment
%d bloggers like this: