Basic Concepts

Contents

[ hide ]

    FeedWordPress is written as a plugin for the WordPress weblog software. It is
    designed to store all the data it needs within the WordPress database and to
    make that data easy to manage from within the WordPress Dashboard.

    Contributors / Feeds

    FeedWordPress uses the WordPress Links database to keep a list of the feeds from which it will syndicate content. WordPress allows you to place links in
    categories; FeedWordPress will make use of all and only the links in one category (by default, this is a category named “Contributors”; you can change the category that FeedWordPress will use using Syndication –> Settings).

    From WordPress’s perspective, the list of Contributors are normal links, and
    they can be manipulated like other links through the WordPress Dashboard.
    However, FeedWordPress provides a nicer interface for adding, removing, or
    changing information for the Contributor Links from the WordPress Dashboard,
    under Syndication –> Syndicated Sites.

    If you want to distribute the labor of adding, updating, and managing feeds between several people, you can use the WordPress login andaccess privileges system. Any users with an access level of 5 or greater can add, delete, and modify Contributors; users with an access level of 6 or greater can change syndication options.

    When FeedWordPress looks for new posts, it retrieves one or all of the
    links from the Contributors category (depending on whether it has been told to scan for new posts on one or all of the feeds), determines which of them should be polled for updates (based on how long it has been since the last time each feed was polled for updates), and then uses an HTTP conditional GET to check for updates at the “RSS URI” for each Link that it selects. Any new posts are added to the database, and old posts that have been updated since the last poll are updated to reflect the new version.

    __Feed settings: __Feed settings: All of the information for a syndicated feed is stored in
    the WordPress Links database, and can be easily edited using an interface that
    FeedWordPress provides under Links –> Syndicated. (If you’re curious about
    the technical details of how the information is stored, you can find out more
    at API: How feed information is stored.)

    You can use a feed’s Edit link under Syndicated Sites to affect how FeedWordPress prcesses posts from that feed. (Most of these options can either be set for one particular feed using Syndication –> Edit, or set as the default for all feeds using Syndication –> Settings.) The Edit link also allows you to set Custom Feed Settings for use in templates, through the use of the href="http://projects.radgeek.com/feedwordpress/api#get_feed_meta">get_feed_meta () template function in a post context (see Appearance). For example, many aggregator sites use a “face” image for each feed to visually distinguish posts from different feeds. To implement a face feature, you could add a custom setting for each Contributor Link, with the key of “face” and a URI such as “http://www.zyx.com/mugs/ugly” for the value. (The URI should be changed out for each feed to point to the appropriate image, of course.) Then, to use the setting from within a template, add something like:

        // In a post context
        <?php $img = get_feed_meta('face'); if (strlen($img) > 0): ?>
        <img src="<?=$img?>" alt="" />
        <?php endif; ?>
    

    … which will display the image, if any, whose URI is set in the “face” setting
    for the feed that post comes from. If there is no “face” setting for a
    particular feed, get_feed_meta() will return an empty string and no image
    will be displayed.

    Syndicated Posts

    Whenever FeedWordPress updates, it scans one or more of the feeds in its
    Contributors list and adds any new posts that it finds to the WordPress
    database. Syndicated posts are displayed on your WordPress pages like any other posts: they can be listed in archives by category, author, or date; they can be found with the search box; and they are included in your blog’s own feed.

    In your WordPress templates (Appearance –> Editor) you can access
    special information about syndicated posts using functions provided by
    FeedWordPress
    , such as is_syndicated(), the_syndication_source(),
    the_syndication_source_link(), and get_feed_meta(). For example, here is
    the template code that I use (in a post context) to display both the author’s
    name and the original source of the post in the templates for Feminist Blogs:

    <cite class="feed">from <?php the_author_posts_link()?><?php
    if (is_syndicated() and (get_the_author() !== get_syndication_source())):
        echo ' @ <a href="';  the_syndication_source_link(); echo '">';
        the_syndication_source();
        echo '</a>';
    endif; ?></cite>
    

    For more information on template functions, see Template API.

    Categories

    WordPress allows for posts to be placed in categories. Each syndicated post
    that FeedWordPress adds to the WordPress database is placed into a set of
    categories. FeedWordPress gets the list of category names to use from two
    sources:

    1. Categories (or “tags”) that the original author placed the post in on
      her blog

    2. Categories that you set explicitly for each feed using the Categories
      checkbox under Links –> Syndicated –> Edit. For example, if you
      wanted all the posts from Alas, A Blog to be placed in the “Pacific Northwest”
      category and the “Cartoonists” category (in addition to any other
      categories that they were placed in on Alas, A Blog), you could do this by
      creating the categories, going to Links –> Syndicated,
      clicking the “Edit” link for Alas, A Blog, and checking those two categories
      under the checkbox captioned “Categories.”

    Given the list of category names, FeedWordPress looks for categories in the
    WordPress database with the same name as either (1) the category name, or
    (2) one of the “aliases” listed in the category description.

    __Aliases:__ Different often authors use slightly different names for categories that mean the same thing (contributors to Feminist Blogs, for
    example, used categories including “Feminism”, “feministy stuff”,
    “Women’s Issues”, “Gender Issues”, “Gender Equality”, and so on). If you want
    FeedWordPress to treat one category name as a synonym for another, you can
    do so by creating an “alias” for the category. For example, to make
    FeedWordPress treat posts that are placed in the category “feministy stuff” as
    if they had been placed in the category “Feminism”, go to **Manage –> Categories**,
    find the category “Feminism” and click the “Edit” link for it, and then add
    the following to the Description field, on a line by itself:

    a.k.a.: feministy stuff
    

    You can add as many aliases as you like. You can also add any other text that
    you like to the Description without interfering with FeedWordPress’s ability to
    use the aliases. Each alias must be on a line by itself.

    __Unfamiliar categories:__ If one of the category names that a feed provides is unfamiliar — that is, if there is not yet any category in your WordPress database that either has that name, or uses that name as an alias —
    then by default FeedWordPress will automatically create a new category with
    that name and place the current post in it. The default behavior can be changed so that unfamiliar categories will not be added to the database, using the **Unfamiliar categories** setting, either for all feeds (under **Options –> Syndication**) or for one particular feed (under **Links –> Syndicated**).

    If you choose to disable the creation of new categories, either for all feeds or for one particular feed, then you can also choose whether or not FeedWordPress should syndicate posts that do not match any of the categories that are currently in the database. This allows you to do some simple filtering of posts by category: if you want to your blog to syndicate only the posts in one particular category from a feed that has several categories, you could do so by creating a category by that
    name, adding the new feed(s), and then setting Unfamiliar categories under Links –> Syndicated –> Edit to “don’t create new categories and don’t syndicate posts unless they match at least one familiar category”.

    Since only posts in categories that are in your database will be included, and only the category or categories that you wanted posts from has been added to your database, this will filter out all the posts that aren’t in the category or categories that you defined ahead of time. (Similarly, you could set up FeedWordPress so that all the feeds are filtered by author by creating the set of users named after the authors you want to syndicate, and then setting the default behavior for all feeds at Options –> Syndication).

    If you need a category filter with more complex logic, you can always create a
    syndicated_item filter in PHP (see Plugin API) that manipulates the
    [1] array of a syndicated item.

    Authors

    Most feeds include information about the author of the items on them.
    (If a feed doesn’t, then FeedWordPress will create an author’s name based on
    the title of the feed from which the item was taken.) This information is used
    to determine the WordPress user that the post will be attributed to. Given the
    name of the author, FeedWordPress looks for authors in the WordPress database
    with the same name as either (1) their login, (2) their display name, (3) their
    e-mail address (if given), or (4) one of the “aliases” listed in the
    user’s profile.

    __Aliases:__ If there is an author who posts under more than one name (for example, one of our contributors at Feminist Blogs posts on several
    different blogs, sometimes using her full name and sometimes using only her
    first name), then you can ensure that FeedWordPress will attribute those posts
    to the same author by creating “aliases” for the author. For example, to make
    FeedWordPress treat posts by “Joseph Cardinal Ratzinger” and posts by “Pope
    Benedict XVI” as having the same author, go to **Users –> Authors & Users**, click
    on the “Edit” link for Pope Benedict XVI, and add a line like this to the
    Profile text:

        a.k.a.: Joseph Cardinal Ratzinger
    

    You can add as many aliases as you like. You can also add any other text that
    you like to the Profile without interfering with FeedWordPress’s ability to use
    the aliases. Each alias must be on a line by itself.

    __Unfamiliar authors:__ By default, if the author named by the feed is unfamiliar — that is, if there is no-one with that name registered in the WordPress author’s database — then by default FeedWordPress will automatically create a new user account with the given name and attribute the post to the new user. The default behavior can be changed, using either the global settings in **Syndication –> Settings** or the settings[2] under **Syndication –> Edit**, so that posts by unfamiliar authors will either be attributed to a default author (instead of creating a new user account to attribute them to), or filtered out and not syndicated at all.

    One of the uses of this feature is to filtering posts by author: if you want to
    your blog to syndicate only the posts by one particular author from a feed that
    has several authors, you could do so by creating a user account with that
    author’s name, adding the new feed(s), and then setting Unfamiliar authors under Syndication –> Edit to “don’t syndicate the post”. Since only posts by authors that are in your database will be included, and only the author that you wanted posts from has been added to your database, this will filter out posts by anyone else on the feeds with that setting. (Similarly, you could set up FeedWordPress so that all the feeds are filtered by author by creating the set of users named after the authors you want to syndicate, and then setting the default behavior for all feeds at Syndication –> Settings).

    If you need an author filter with more complex logic than this allows, you can
    always create a syndicated_item filter in PHP (see Filters and Plugins) that manipulates the [3] or [4][5] elements of a syndicated item.

    This page is a Wiki! Log in or register an account to edit.

    2 thoughts on “Basic Concepts

    1. I’m running FeedWordPress (build 2012.0810) on one of my sites.
      The a.k.a. alias doesn’t appear to be working for categories any more – has that functionality been removed?

    Leave a Reply

    Your email address will not be published. Required fields are marked *