Posts Tagged ‘wordpress’

Google Analytics: Inserting Into a WordPress Template

Saturday, March 29th, 2008

Google Analytics is a great tool for gathering data about your website. You can track and analyze all kinds of data about your visitors, their navigation paths, and the effectiveness of your content.

To use Google Analytics, you need to place some javascript on your website. A commonly asked question in forums is, “How do I add Google Analytics to my WordPress template?”
(more…)

Moving WordPress: Individual 301 Redirects with PHP

Sunday, March 23rd, 2008

I recently decided to move part of an old blog to an independent site.

In order to maintain the meager search engine and referral traffic that the old pages had, I planned on using 301 Redirects. I figured that I would re-create each of the old articles (~10 total articles) on the new site and set up an individual 301 Redirect to send users and search engine spiders to the new location.

The problem, however, was that the standard .htaccess rewrite that WordPress uses was conflicting with the 301 Redirects. For some reason, they just weren’t working – so I turned to a PHP-based solution.
(more…)

Five Useful, Simple WordPress Plugins

Thursday, March 20th, 2008

I’ve been playing around with developing WordPress sites for a while now. I love how quick and easy it is to launch a site and update content.

One of the greatest features is the thousands of plug-ins available for WordPress. You can find a plug-in for just about anything you want to do – or if you have some PHP know-how, you can develop your own.

Here are five basic WordPress plug-ins that I’d recommend using for any project you start.
(more…)

Anatomy of a WordPress Template: The Basics

Monday, March 10th, 2008

There are tons of free WordPress templates available, but at some point you’ll probably want to modify one or make your own. Even if you know HTML pretty well, this can be a daunting task at first.

WordPress templates have a decent amount of simple PHP mixed in, and you need to utilize a special file structure for the template to operate correctly. Before you dive into making a WordPress template, let’s look at the basic structure of a WordPress template compared to a normal website template.
(more…)

How to Time Delay Posts in WordPress

Saturday, March 8th, 2008

One reason I’ve heard people say that they prefer a full-blown CMS to WordPress is that WordPress doesn’t allow time delayed posting. I was about to figure out a way to mod WordPress to make this possible – until I realized that there is some decent built-in functionality for time delaying.

You can easily delay the release of your posts into the main indexes (front page, archives, “Recent Posts” list, etc). With a little bit of code, you can also restrict people from viewing the page before its appointed “Published” date.
(more…)

Add Custom Loops (Queries) to WordPress

Sunday, March 2nd, 2008

If you look at your WordPress template, the thing that drives your page is called “the loop.” That’s WordPress speak for looping through the result set (the posts) retrieved from the database.

If you wanted to make custom queries, you could certainly do that by diving straight into the database. However, WordPress comes with some built in functions for helping you query the database and display the results. By using these template tags, you can add custom loops in your template to display other post information.
(more…)

How to Only Show the Digg Badge for Popular Posts

Monday, February 18th, 2008

Digg can be a great source of traffic and recognition for tech related blogs. Some people take it to the extreme though, and show the “Digg This” badge on every article they write.

As others have pointed out, this can be counter-productive. People don’t like to read articles that have just one Digg – they seem unpopular.

So here’s a solution: use the Conditional “Digg This” WordPress Plugin to only show the Digg Badge for articles that have a certain number of Diggs.
(more…)

Fixing a WP Plugin: Per-Post CSS and JS

Sunday, February 17th, 2008

A few weeks ago, I installed the “Per Post CSS and JS” plugin for WordPress. This allows you to add a custom field to your post and include extra .css or .js files to link to that individual page.

I only realized today – while testing something else – that the plugin had been firing off warning messages because of an oversight in the code. Warning messages annoy me, so I decided to fix it up.
(more…)

How to Modify a WordPress RSS Feed Widget with Rel=Nofollow

Saturday, February 9th, 2008

I just added an RSS feed widget to my site (see the lower right corner – the DZone links). I frequent dZone a decent amount, and I find a lot of the articles interesting.

However, after some thought I became concerned that ten sitewide external links might be a bit of a drain on my pagerank. If only I could add “rel=nofollow” to all those links. But there’s no option in the RSS Widget to do that.
(more…)

How to Use Custom Stylesheets on a Per Post Basis in WordPress

Tuesday, February 5th, 2008

Something I struggled with recently was assigning individual style sheets to posts on this WordPress blog. For example, if I was writing a CSS tutorial I didn’t want to muck up my general stylesheet with a bunch of styles – it’d be nice to write a small stylesheet and attach it only to the specific post that needs it.

Unfortunately, this isn’t a built in function of WordPress. Fortunately, you can add this functionality with a plugin.
(more…)