Timberline Employee Blog

From our living-room to yours

Entries Comments



How to use WordPress 2.3 built-in tags

17 September, 2007 (12:29) | WordPress | By: Ben

WordPress 2.3 now has built in tags. Tags are similar to categories.You’ll need to have these installed and running.
WordPress 2.3
Tag Suggest Thing

Tag Suggest Thing by the author of Ultimate Tag Warrior will query Yahoo for tag suggestions. This is easier than trying to come up with tags yourself and type them in.

At http://richgilchrest.com/how-to-add-wordpress-23-tags-to-your-current-theme/ we learn how to add a tag cloud to your theme. There are two suggested places this would be good at. As a widget using Execphp, or directly in your themes code.

If you are using execphp you would add in a simple line of code that looks like:

<?php wp_tag_cloud(’smallest=8&largest=36&’); ?>

For more options see the WordPress document. (smallest, largest, unit, number, format, orderby, order, exclude, include)

The other way to see a tag cloud is to edit your theme directly. You can add it to each post, or add it to a side column. To add it to each post you will edit your themes index.php and single.php. And add code like the code above.

If want a tag cloud in a side bar you would add this code to your themes sidebar.php.

<?php if ( function_exists(’wp_tag_cloud’) ) : ?>
<li>
<h2>Popular Tags</h2>
<ul>
<?php wp_tag_cloud(’smallest=8&largest=22′); ?>
</ul>
</li>
<?php endif; ?>

If your theme is widget ready, consider using the tag cloud widget instead.

 

Automatically Add RSS Aggregated Feeds as Posts to Wordpress 2.2

20 June, 2007 (13:31) | WordPress | By: Ben

Here is a how to showing how to add RSS Feed Aggregation to Wordpress 2.2.

Required: Wp-o-matic, Wordpress-2.2

First, let us not find out what kind of fun it is to replace work without a backup.

About the wp-o-matic 0.2 beta archive. It was made on a mac and I had to use a program other than the built in Windows XP Zip Folders to extract the archive entirely. WinRar extracted without difficulty but I still had to erase the extra .DS_Store files and __MACOSX directory.

Wp-o-matic version 0.2 beta had a problem in the mysql field description. This was my first stumbling block. Fix this first even if your tables use the default wp_ prefix.

On line 334 of wpomatic.php version 0.2 beta, replace the hardcoded “wp_rssfeeds” with {$this->dbfeeds} .

Now locate the directory your theme is stored in and open index.php. Somewhere in index.php you should find <?php the permalink() ?> next to ‘read more’, depending on the theme you use. Change this to say:

<?php $a_wprss_link=get_post_custom_values(”wprss_link”); if(!empty($a_wprss_link)){echo $a_wprss_link[0];}else{the_permalink();} ?>

This uses the get_post_custom_values() to pull the link data from the post created by Wp-o-matic. If there is nothing in this field then the regular permalink is used.

Good. If you haven’t already uploaded the wpomatic folder to your plugin directory do that now.

Turn on the plugin. If your database tables do not start with wp_ and you get an error here reguarding the database, read the part above that you skipped over a little to fast. Other errors are likely directory permission settings. Try chmodding to 777.

Then go to Options/wp-o-matic and enter in a feed to test. If all goes well you have a working RSS Aggregation system.

Now the interface does not let you enter complicated urls like http://news.search.yahoo.com/news/rss;_ylt=A9j8eu.hUnlGwfcAtRfQtDMD; ylu=X3oDMTA3MTBsZGZsBHNlYwNhZG0-?ei=UTF-8&p=chrysler &c=&eo=UTF-8, so if you have phpMyAdmin installed use it to load the url. Wp-o-matic will then be able to pull feeds where it wasn’t before.

If you want would like to add a target=_blank for outside links only then enter the following inside the <a href> defination next to the code we entered above. Note the code we entered above will be sourounded by quotes so you need to paste this outside of those quotes so this doesn’t become part of the link.

<?php $a_wprss_link=get_post_custom_values(”wprss_link”); if(!empty($a_wprss_link)){echo ‘target=_blank’;} ?>

The idea here is to always open rss links in a seperate window and open internal links in the same window.

Let me know if this helps.