Add Google’s 1+ icon to a WordPress Blog

Here’s a pretty simple tutorial to add the Google+ icon to blogs to allow people to 1+ your article:

Step 1 – get a Google Webmaster Tools account for your domain
Go to https://www.google.com/webmasters/tools and set up an account for your domain. This is actually quite useful because it tracks a few different things than analytics…such as search engine performance, keywords, etc.

Step 2 – copy the 1+ code for your site

Step 3 – paste the code into your WordPress template
There are 2 pieces of code to place. First, place this code in your header.php file in your theme editor:

<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

Next, place this code in the content-single.php file in your theme editor right before the closing “header” tag in the “article” tag:

<g:plusone></g:plusone>

That’s it! Hope it works!

Beginning in HTML5

Look here soon for posts on HTML5 and how it plays with Drupal 7, Sharepoint 2010, and WordPress.

Moving WordPress

Moving WordPress is………fun. These instructions are for moving wordpress from your local machine to your domain. Note, this assumes you have access to create new databases, and access phpmyadmin from your localhost and your domain name. Also, an FTP client, or a browser-side FTP client will be necessary.

Step 1

Zip up your entire site. Upload it to your server, unzip.

Step 2

Go to phpmyadmin, export your SQL file (you can either save it as a file to upload, or just copy the output…doesn’t really matter). Go to phpmyadmin on your domain (assuming you have created a new mysql database in which to dump the SQL), and paste/upload the mysql dump from your local machine.

Step 3

Change 4 things:

  1. Find the “wp_options” table in your new mysql database. Locate the item with “siteurl” in the option_name column. Change the option_value of that from “http://localhost/test…” to “http://www.yourdomain.com”. This sets the site URL of the wordpress installation to your domain name.
  2. In the same “wp_options” table, do the same thing to the item with “home” in the option_name column. Change the option_value of that from “http://localhost/test…” to “http://www.yourdomain.com”.
  3. In the .htaccess file, make sure that these two options look like this if your website is at the root of your domain name:
    RewriteBase /
    RewriteRule . /index.php [L]
  4. Open wp-config.php (in the root of your wordpress installation) and set your Mysql database settings to the new settings on your domain hosting. These include: DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST. If your tables do not being with “wp_”, then a few more lines down the page you will need to change the $table_prefix line as well.

Everything should work as normal once those 4 things are changed. Let me know if you need help, or are experiencing problems.

How-to Setup WordPress on MAMP (5 Easy Steps)

1.       Setup a new MySQL Database through MAMP’s phpmyadmin. Name the database something you will remember. Mark down the name of the database, the server it is located on (usually localhost or 127.0.0.1, sometimes with a port number as well…8888 in my case), the username, and the password (usually root and root if you’re on localhost). You will need these 4 things later.

2.       Download and unzip the latest version of wordpress from wordpress.org

3.       Drop this into the htdocs folder inside Applications>MAMP>htdocs, rename the folder to match your site (in my case bentedder)

4.       Open up firefox and navigate to your new URL (assuming apache & mysql are turned on). http://localhost/bentedder

5.       Follow the login prompts, using the 4 items you have from step 1 (db name, server, username & login)

Done, start Blogging!

Drupal vs. WordPress

As a web designer, it is important to be familiar with your tools. For months, almost years at this point, I’ve been a strong advocate of Drupal. I admit, I only started when it was in version 6, but still….

Recently I’ve started using and designing in WordPress. It’s interesting, the two do very different things. Here’s a little pros and cons list as it plays out in my head.

Feature Drupal Wordpress
Theming Relatively easy Very Easy
Expandability Amazing Limited
Ease of install Very Easy Very Easy
Ease of transfer Very Easy Somewhat Easy
Size/Bulk Quite big Quite small
Navigating files Difficult Easy

That’s a short list. I still prefer drupal for the bigger sites that require lots of customization, and obviously that aren’t blog-centred. But for blogs and very simple sites, I’m thinking of switching to wordpress for a quick win for clients.

Any thoughts?

Show the summary on WordPress homepage

Go to your theme, content.php file (i’m using the toolbox theme)

Replace:

the_content

with:

the_summary

The best thing about WordPress

Plugin: Postie

It allows you to send an email to post to your blog. I’m in China, so I can’t actually access my own website from home without using some sort of tunnel or VPN. But luckily with Postie I can send an email and it posts to my blog for me! Awesome!