Posts Tagged with “WordPress”

More robust footer widget areas for Headway

I recently got an email from a reader who wanted to know how I implemented my footer widget areas, and seen some similar requests in the Headway forums. With Headway, you can flip your widget areas horizontally to make a widgetized footer but it works best when you only have 3-4 widgets in them. I wanted to have more flexibility and so I injected 3 widget areas into my footer.

Screenshot for posterity, if I ever re-design this blog. Click for full-size image.

I didn’t have time for a full tutorial but hopefully you’ll find these code snippets useful:

blogjunkie.net custom_functions.php for Headway theme

blogjunkie.net custom.css for fat footer widget areas

Last week, Automattic announced Jetpack, a bundle of plugins that will bring the hosted WordPress.com features into self-hosted WordPress blogs. On the surface it sounds like a great addition to the WordPress platform, but James from WPMU.org points out some far reaching implications.

@xescx explains a useful tip on how to roll your own Twitpic service with WordPress.

Solved: Cufon text not refreshing on jQuery UI Tabs

Update: I no longer use Cufon in my projects and prefer @font-face. If you are struggling with Cufon it will actually be faster for you to replace it with @font-face than to figure out your Cufon problems. Start with this tutorial here: The Essential Guide to @font-face

Today I was working on a project that:

  1. Made use of jQuery UI Tabs through the WordPress Post Tabs plugin
  2. Uses custom fonts for the tabs via Cufon
  3. Requires tab font to change color when selected

Read More »

Here’s a guest post I contributed to the Headway blog:

Recently I launched a redesign of my personal blog (blogjunkie.net) which essentially turned it into a tumblog. I achieved the look and functionality with the Headway theme and the WooTumblog plugin. I received a few questions about the redesign so here is a tutorial on how you can do the same with your Headway blog.

What is a tumblog / tumblelog?

Some people were confused with the concept of a tumblog so I thought I would explain it first.

A tumblog is a publishing tool that is in between Twitter (140 characters) and full-blown blogging (500+ words). It’s great for times when you have more to say than what Twitter will allow, but not so much that it deserves an entire blog post. I simply wanted to post a link / image / video and add a comment to it, without worrying about the post formatting. A tumblog is perfect for that.

Five Nerds and Projectionist are typical examples of tumblogs–short form snippets of content with occasional long posts.

Bulletproof domain redirection for CPanel Add-On domains

Recently I helped my friend Beth Heavrin of Smart Green Tips to migrate her blog to a new domain name. Along the way I realized that the simple way of domain redirection doesn’t work as well for websites that are add-on domains in CPanel environments. This article shows you how to create bulletproof redirects that will work, even for add-on websites.

The Problem

CPanel site structure

In CPanel environments, you start off with a primary domain that resides in the public_html directory. When you add new site to your CPanel hosting, they are added as add-on domains whose root folder are subdirectories of public_html.

You end up with a directory structure in your web hosting account like the image on the right.

Simple .htaccess Redirects Don’t Work

For our example, let’s assume that the primary domain is PrimaryDomain.com and the new domain we want to redirect it to is AddOn1.com. To redirect PrimaryDomain.com to AddOn1.com, you may have used this code in the .htaccess file for PrimaryDomain.com:

# Redirect 301 / http://www.AddOn1.com/

Or, you may have used this code:

# RewriteRule ^(.*) http://www.AddOn1.com/$1 [R=301,L]

With the code above, PrimaryDomain.com will get redirected to AddOn1.com. But unfortunately visitors to AddOn2.com will be wrongly redirected to AddOn1.com/AddOn2.com. Same for other add-on domains within the public_html directory.

This is because AddOn2.com is a subdirectory of public_html. The 2 code snippets above redirect everything, including add-on domain subdirectories to AddOn1.com. Confused? Never mind! Just use the solution below.

The Solution

The solution is to check the hostname (URL) that the visitor is trying to visit before redirecting them. So, let’s update our .htaccess file to the following:

# Redirect PrimaryDomain.com to www.AddOn1.com
RewriteCond %{HTTP_HOST} ^PrimaryDomain.com$
RewriteRule ^(.*)$ http://www.AddOn1.com/$1 [R=301,L]

#Redirect www.PrimaryDomain.com to www.AddOn1.com
RewriteCond %{HTTP_HOST} ^www.PrimaryDomain.com$
RewriteRule ^(.*)$ http://www.AddOn1.com/$1 [R=301,L]

The first block of rules only redirects visitors to PrimaryDomain.com and the second block only redirects visitors to www.PrimaryDomain.com. Visitors to AddOn2.com or AddOn3.com will not be redirected. Solved!

WooThemes has released a new plugin that turns your regular ol’ WordPress blog into a tumblog. All that is required is to install the plugin and change a few lines of code in your theme’s templates. I’m using it now on this blog and found it pretty straightforward to integrate.

Remove Headway update notifications

As you know I’m a big fan of the Headway WordPress theme. So much so I’ve been using it in client projects.

The one (small) drawback is that Headway puts a notice in the Dashboard every time there’s a new version. For certain clients I really don’t want to have anything to do with them after the project, so I would like to disable the notification. Here’s how.

In Headway’s custom_functions.php, simply add this line:

remove_action('admin_notices', 'headway_update_notice');

Solved. No more nagging client asking me what is this “Headway update thing”.

Theme Frameworks: A Glimpse Into The Future Of WordPress Themes [WordCamp Malaysia Presentation]

This was my presentation at the 1st ever WordCamp Malaysia where I was fortunate enough to be invited as a speaker.

Theme frameworks are the next evolution in WordPress themes. They’re still relatively new, so let’s start off by asking…

What is a Theme Framework?

Theme frameworks for WordPress can be a little confusing, and it doesn’t help that there are many blank themes that call themselves ‘theme frameworks’.

In my opinion, theme frameworks are a solid base that serves as a starting point for other projects. A defining characteristic of theme frameworks are theme hooks (actions & filters) and when developing for a theme framework, it feels a little like developing a plugin. Examples of theme frameworks are Thematic and Hybrid. Read More »

New to blogging? Tell me what you'd like to know

Last weekend, I conducted another workshop for the New Straits Times NIE Inside Scoop series. I’m happy to say it went well and that I will be conducting another workshop in June, this time on Blogging.

The workshop is aimed at beginners and hobbyists who want to get serious about using blogs to promote your business, reach your customers and make money from your passion. The workshop will have a strong focus on WordPress, the publishing platform that powers this blog and other popular sites like Mashable, Smashing Magazine, Paul Tan’s Automotive News, and Hong Kiat.

Help needed – what topics would you like to know about?

I’ve already got an outline, but I would love your feedback and suggestions, especially on specific stuff. Let me know what you think 🙂 Read More »