Tag Archives: php

How to Add RSS Feed Link to archive.php for WordPress

archive.php (in the WordPress theme folder) is the file that handles the output of posts grouped by categories, tags (in WP 2.3) and by dates. Since I have a wide variety of topics, I figured it would be helpful to provide feeds specific to a reader’s particular interest(s). The problem was I didn’t know how to do it easily. After playing around with the code, I came up with a solution which turned out to be pretty simple and straightforward. It is probably not perfect but it gets the job done.

Wherever you want to place the link, add this code:

<a href="feed/">Subscribe to Feed</a>

So, if you’re interested in my WordPress postings, you can use the link to the feed when viewing the WordPress category.

Added CpmFetch to WordPress blog

I have added CPM Fetch to my blog. The author, vuud, describes CpmFetch as:

…a PHP object that allows you to easily display random or latest images from your coppermine gallery on external php and html pages… You can draw images (random or otherwise) from the entire gallery, a specific category or a single album.

I’m using CpmFetch to display a random image from my gallery. You can see it in the sidebar.

The code to put into the theme’s sidebar file is:

	<li>Random Photo</li>
		<div align="center">
		$objCpm = new cpm("$cpm");
		$options = array( 'subtitle' => '<a href="http://takethu.com/displayimage.php?pos=-%i">Details</a><br/>
										Album: %a<br/>
							'imagelink' => 'large',
							"linkstyle" => 'highslide" onclick="return hs.expand(this)" onmouseover="self.status='Click to enlarge thumbnail'; return true;',
		$objCpm->cpm_viewRandomMedia(1,1, $options);



I defined the cpm variables earlier in my file based on if it is the local or remote installation. You can either create and define the variables with your settings or just replace the variables with your own settings.

The code is written to work with Highslide JS so you would need to tweak the code if you don’t want to use it.