CG-Feedread


CG-Feedread is an RSS/Atom aggregation script to pull in feeds and display titles or posts from other sites on your blog (Figure 30).

Figure 30. Use CG-Feedread to display information from other feeds in your blog.


CG-Feedread is by David Chait of ChaitGear. It's part of the CG-PowerPack, which can be downloaded from www.chait.net/index.php?p=238. Be sure to download the most recent version; although it may say it's for WordPress 1.5.1, it'll also work with WordPress 2.

Tips

  • Although the CG-PowerPack package includes several plugins, we're only covering CG-Feedread in this book. Explore the other plugins on your own.

  • In the future, the Chaitgear plugins may move to chaitgear.com.


To install & activate CG-Feedread

1.

Open the CGPP1531 folder you downloaded. It contains all of the files that make up the CG-PowerPack package (Figure 31).

Figure 31. The contents of the CGPP1531 folder and its plugins folder.


2.

Open the plugins folder (Figure 31).

Figure 32. In this example, we're using Fetch on a Mac to install the CG-Feedread files.


3.

Use your FTP client to upload the cg-feedread-plugin.php file and cg-plugins folder to the plugins folder in your wp-content folder (Figure 32).

4.

On the server, set the permissions for the wp-content/plugins/cg-plugins/cache_feedread folder to 777 (Figure 33).

Figure 33. You can use your FTP software to set a folder's permissions.


5.

In the Plugin Management administration panel, activate the CG-Feedread plugin.

Tip

  • We tell you more about using FTP software in Appendix B.


To use CG-Feedread

1.

Use your favorite text editor to open the theme template file in which you want to display the feeds. In most cases, this will be sidebar.php, but it could be another file.

2.

Insert the following code where you want the feed to appear, substituting the feed's URL for the italicized URL shown here:

<?php $feedUrl = "http://example. com/index.rss"; // an example $feedOut = getSomeFeed($feedUrl, 5, false, "feed-example", '', 20, false); if ($feedOut) echo $feedOut; ?>


Figure 34 shows an example using the Default theme's sidebar.php file.

Figure 34. In this example, we're inserting the code for CG-Feedread into the sidebar.php file.


3.

Save the edited file.

4.

Check your blog to see if the modifications are functioning as expected. You should see a list of five headlines from the feed you specified in step 2. In our example, we used the feed from TiKouka; we can now see five headlines from that blog in the sidebar of our test blog (Figure 30).

Tips

  • The second line of code in step 2 includes seven parameters you might want to modify to better meet your needs:

    • $feedUrl is the feed URL.

    • 5 is the maximum number of items.

    • false (the first instance) tells CG-Feedread not to show article details or body.

    • "feed-example" is the name of the feed's cache on your server. It must be unique.

    • '' (an empty string) is for filtering a feed by category or key word. Normally, you'd leave this as shown here.

    • 20 is the maximum number of characters to display for each item.

    • false (the second instance) strips out any HTML from the displayed text.

  • You can find additional information about CG-Feedread parameters in the feedreadReadme.htm file in the CGPP1531 folder (Figure 31).





WordPress 2. Visual QuickStart Guide
WordPress 2
ISBN: 0321450191
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net