A very basic guide to hooks, actions and filters for WordPress.

Part of WordPress’s power is the fact that it is so extensible. The tools in the WordPress toolbox to achieve this are hooks, actions and filters. But some of the documentation can be very intimidating, so in less than 200 words I will provide you with a basic guide to hooks, actions and filters.

Hooks simply refer to where your custom code will be executed.

There are two types of hooks: action hooks and filter hooks.
Action hooks do something in your code. (You can either add or remove actions using the very handy and intuitive code: add_action or remove_action)

Filter hooks modify something in the code, so instead of doing something entirely new or different…it simply changes your code. The very intuitive code to add a filter is: add_filter.

That’s it, a very basic guide to hooks, actions and filters for WordPress.

Read more:

CSS Tricks: Using Color

css_blocks

As web designers we sometimes have a tough time figuring out exactly why a particular layout item is behaving that way. Sometimes it’s a matter of the cascade being at play, other times it’s a specific rule that we have set.

One of the best tricks that I have discovered is the use of blocks of color when initially setting up a layout or when debugging it.

There are some important notes about this:

  • Your layout will look as though it was colored in by a 5 year old on a sugar high in a crayon factory. This makes it easy to spot the culprit for breaking the layout, but it can be painful to look at.
  • I use two things to make sure I know that the color is not supposed to survive into the final .css file:
    • I use the color names rather than hex codes.
    • I also include a comment /*debugging*/ next to each item.

This post features one of my examples (in this case with a right sidebar, and navigation across the top of the page). You can view and download the HTML and the CSS from Google Drive.

This is one of the easiest CSS tricks that I have found when playing around with a layout. I picked it up from a tutorial by Russ Weakley a couple of years ago and it has saved my sanity a couple of times.

The First Rule of Web Design

The single most important thing when it comes to web design is content before anything else. In order to determine what content you should place on your website, which will in turn shape your page layout, navigation, etc. you need to decide what purpose your web site will fulfill.

Your goal of your web site might be:

  • To establish yourself as an expert in a particular field.
  • To communicate specific information to customers.
  • To attract new customers.
  • To make sales.
  • etc.

Unless you know what you want to achieve with your web site and what type of information that your users are likely to be looking for, it will be difficult, if not impossible to have an effective web design. Here, at Red Dragon Creative, we define an effective web site as one that helps fulfill a business goal.

In order to determine your content you need to consider your web site’s goals and your target audience. From there, you will be able to decide what type of content your users will expect and find useful. You will also be able to decide what format is most appropriate. Perhaps your users love to read blog posts? Or maybe they prefer to watch a video? Or perhaps they are a fan of infographics?

Once you know what type of content your users are likely to want included in your web design, you are able to ensure that your site is developed to allow your visitors to easily flow through your site…without giving your design a second thought.