JPF Category Feeds WordPress Plugin
The JPF Category Feed plugin allows you to easily list the RSS category feeds for your post. It is quite flexible, allowing a number of parameters that can derive horizontal and vertical listings or even ‘sentence’ form. Installation is simple, copy the jpf_catfeed.php file to your WordPress plugins folder and activate in your Plugins Management tab. The optional rss.gif file can be copied anywhere in your site, and can be referred to as specified below. Then, place the following code in ‘the loop’:
<?php jpf_catfeed([Image], [Images], [Before], [After], [Separator], [And]); ?>
- Image is the path to an image that will preceed the list. The image is not linked to anything, it is simply decorative.
- Images is an image that will preceed each category link, the image is included as part of the link.
- Before is anything you want to preceed each category link, commonly this would be used to define each category as a line item in a list, or to define CSS, but could also be brackets or other symbols.
- After would typically be used to close a tag that was opened with Before
- Separator is the text you want to separate the category links, most commonly a comma and space, or a vertical bar.
- And defines if you want the word ‘and’ followed by a space to separate the last two items, generally used if you are listing the categories in a sentence format. Set to true if you wish to use.
If you simply include <?php jpf_catfeed(); ?> you will get a line of your categories separated by a vertical bar (eg. “category1|category2|category3″).
Here are some examples of it’s use:
In this example, wrapping the function in an unordered list, and specifying $before = ‘<li>’ and $after = ‘</li>’ will give you a simple unordered list of your categories.
<ul><?php jpf_catfeed(”,”, ‘<li>’, ‘</li>’); ?></ul>
Here an icon is included before each link. The icon is part of the hyperlink to that category.
<?php jpf_catfeed(”,’/wp-images/icons/rss.gif’, ”, ”, ‘, ‘); ?>
category1, category2, category3
Here the separator is changed to a vertical bar with a space on each side instead of a comma followed by a space.
<?php jpf_catfeed(”,’/wp-images/icons/rss.gif’, ”, ”, ‘ | ‘); ?>
category1 | category2 | category3
Here an icon is included before the first category, a comma and space is used to separate the items, and the last category is preceeded by ‘and’ instead of a comma.
<?php jpf_catfeed(‘/wp-images/icons/rss.gif’,”, ”, ”, ‘, ‘, true); ?>
category1, category2 and category3
Posted: 06 November 4
Viewed: 10,946 views