Wowhead powered ItemStats for WordPress
With recent updates to WordPress and the lack of development support for the ItemStats Plugin, there’s now a new (and much easier method) for adding WoWhead item links to your blog.
Step 1: Add the following code to the <head> section of header.php (\wp-content\themes\yourtheme\header.php):
Step 2: Create a link to any wowhead item (ex: Dark Iron Smoking Pipe)
Step 3: Enjoy
Maybe you’ve noticed our new fancy-pants item popups (ex: [item]Tenacious Defender[/item])?
Since a lot of you have your own blog, (we’re updating our blogroll on a daily basis with all the new finds) I figured I’d give a quick rundown on how to implement the item popups for WordPress. If you’re using something else like Blogger, Resto4Life has a nice rundown on a database-agnostic method here.
If you’re willing to get your hands dirty, ItemStats is an awesome plugin that gives you a completely automated and dynamic item linking experience. The only hangup that I have with Itemstats is that it doesn’t support Wowhead out of the box. It supports Thottbot and Allakhazam for english item queries but Wowhead is the superior database in my opinion.
First and foremost, make sure everything is backed up (I highly recommend utilizing a sandbox environment to test things out in). Unzip the contents of the zip file to the root folder of your WordPress Blog (this folder should contain the wp_content and wp_admin folders as well as a slew of wp-*.php files and is most likely either the root of your website or the /blog/ subfolder).
Now if you choose to use the all-in-one ItemStats-WowHead.zip file, the only thing that requires input is the itemstats/config.php file–update this file with your own database information. Contact your hosting provider if you’re not sure of your WP database location or credentials.
If you went with the separate installation method, make sure to check out the readme files in each respective archive to determine which files need to be modified.
After everything is unzipped and in its place, login to your WordPress Admin and head over to the plugins section and activate ItemStats. Now to add an item to your one of your posts, all you need to do is include the item’s name or id surrounded by the [item] tag somewhere in your text. ItemStats parses out the [item] code and replaces it with a swanky popup when you hover over the link with your mouse. It also caches data and downloads the icon for items you’ve already linked so you’re not constantly making trips to Wowhead’s servers.
[item]3567[/item] produces [item]3567[/item]
[item]Fight Club[/item] gives you [item]Fight Club[/item]
You can even use the icon instead of text with the [itemico] tag if you fancy.
[itemico]A Frayed Knot[/itemico] magically conjures [itemico]A Frayed Knot[/itemico]
One nasty issue that I did come across was the inability for the plugin to create the item_cache table in the database. I’m not sure why this happened and it may not happen to you, but if it does, it’s a simple fix.
Just execute the following query on your WordPress Database:
CREATE TABLE IF NOT EXISTS `item_cache`
(`item_name` varchar(100) NOT NULL DEFAULT ”,
`item_id` varchar(100) DEFAULT ’0′,
`item_lang` varchar(2) DEFAULT ”,
`item_link` varchar(100) DEFAULT NULL,
`item_color` varchar(20) NOT NULL DEFAULT ”,
`item_icon` varchar(50) NOT NULL DEFAULT ”,
`item_html` text NOT NULL,
UNIQUE KEY `item_name` (`item_name`),
FULLTEXT KEY `item_html` (`item_html`)) ENGINE = MyISAM;
Again, get your hosting provider to help if you don’t have access (phpadmin will work) or aren’t that comfortable with haxing your datas.
If any of you have any issues, feel free to drop me a line. I’ll be happy to help out.