Listing Categories and Tags

In an earlier post, I showed how you can use OnlyWire to add your favourite sites to 22 social networks. I have added the link to my standard blog template, so that all my visitors can use it.

The only thing that really tripped me up was getting a list of my categories or tags for each posts, so that I can implement the OnlyWire link easily for my visitors.

Here is the code that used to create an OnlyWire link for each of my posts. I added this to my Main Index Page, Single Post and Page templates.

You will need to install the Exec-PHP plug-in for Wordpress.

Add this code just above where you want your OnlyWire link to appear inside the php tag brackets:

$posttags = get_the_category(’, ‘);
foreach($posttags as $tag) { $keywords[] = $tag->name; };
$page_keywords = implode(’,',$keywords);

To build the link to OnlyWire, use the following string, with the right tags:
http://www.onlywire.com/submit?u=URL&t=TITLE&tags=TAGS

substitute the following:
URL = the_permalink()
TITLE = the_title()
tags = $page_keywords

You can also use image as the anchor - img src=http://www.onlywire.com/i/onlywire.ico align=absmiddle border=0

Use the php tags as appropriate.

Good Luck

Popularity: 37% [?]

Keep Updated!

Subscribe via RSS

Or Subscribe via Email and Choose a Free Product

Email:
Name:

Technorati Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Related Post

One Response to “Listing Categories and Tags

Leave a Reply

145 views