Stylehive It Plugin for WordPress

A couple of my cousins run a fashion blog at Shopchicks.com and have been promoting some of their posts via Stylehive.com, a Digg-style bookmarking service directed at fashion and trendy items found on the Internet.

To make their lives easier, and perhaps for other fashionista bloggers out there, I created a new WordPress plugin that adds a Stylehive bookmarklet below each post as well as your Stylehive badge.

Some details on the plugin:

Plugin Name: Stylehive It
Description: Easy plugin that allows your visitors to bookmark your fashion-related posts to their Stylehive.com account. Also adds your Stylehive badge.
Version: 0.1
Author: Andrew dela Serna
Demo: Shopchicks.com

Click here to download the plugin.

Installation:

1. Download the plugin from http://www.alleba.com/blog/wp-downloads/stylehive-it.zip
2. Extract and upload the contents of the archive to ‘yourserver.com/wp-content/plugins/stylehive-it/’
3. Login to your WordPress admin panel and browse to the Plugins section.
4. Activate the Stylehive It plugin.
5. Go to the Presentation section to edit your post template (usually named single.php)
6. Add the line:

< ?php stylehive_it("ALL"); ?>

after the post body to show the “Add to Stylehive” link for all posts. You may also insert specific category ID’s so that only posts belonging to those categories will display the “Add to Stylehive” link.

Sample:

< ?php stylehive_it("1,4,16,21"); ?>

*The category ID’s should be divided by commas.

To check which categories you want included, go to your Admin panel > Manage > Categories, and look at column “ID“.

7. To add your Stylehive badge, Add the line:

< ?php stylehive_badge("username", "background color", "tags"); ?>

preferably within your sidebar.php template.

You must have a current Stylehive account to display your badge. Visit http://www.stylehive.com/ to register.

When registered, add your User Name in place of username between the quotes.

Available background colors are: green, orange, red, grey and white, just like if you create your badge from the Stylehive website.

Tags refer to a set of products that you would want the badge to display, for example, “shoes” or “skirts” or “bags”. Make sure though that you do have bookmarks marked with these tags, or else the badge will show nothing. If you prefer to show all of your bookmarks, leave the tags empty (“”).

Sample badges:

< ?php stylehive_badge("stylehiveuser", "red", ""); ?>

// displays user stylehiveuser’s badge, with a red background, all products

< ?php stylehive_badge("stylehiveuser", "green", "shoes"); ?>

// displays user stylehiveuser’s badge, with green background, all products related to shoes

!!Be sure that the inserted code contains the username, background color and tags, whether blank or not, or else it will end up with an error.

Sample badges with missing variables that will not work:

< ?php stylehive_badge("stylehiveuser", "red"); ?>

// no tags

< ?php stylehive_badge("stylehiveuser"); ?>

// no background color and tags

For comments, suggestions, bugs, complaints, simply reply to this post.

Leave a comment

Your email address will not be published. Required fields are marked *