WordPress.org

Ready to get started?Download WordPress

Forums

Static Item on top of RSS feed (6 posts)

  1. SpeekGeek
    Member
    Posted 9 years ago #

    Is there a way I can add a static item to the top of my RSS news feed?

    I.e. one that links to my forum or the homepage itself instead of just showing the latest article I have posted?

  2. Denis de Bernardy
    Member
    Posted 9 years ago #

    not that i know of, but it's a rather simple hack. just filter the_posts with your plugin and push your static page to the front of the list.

  3. brainwidth
    Member
    Posted 9 years ago #

    You can edit the description in your feed file to include a link.

  4. SpeekGeek
    Member
    Posted 9 years ago #

    Excellent, I added the link in the file "wp-rss2.php"

    Tip - insert it before the line:-

    <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>

    or your link will repeat on every second entry.

    I don't know if that was the directions I was given but it worked.

    Thanks

  5. SpeekGeek
    Member
    Posted 9 years ago #

  6. SpeekGeek
    Member
    Posted 9 years ago #

    I just discovered that you not only have to modify the wp-rss2.php file but if you want to be thorough, the following ones also :

    wp-rss.php
    wp-rdf.php
    wp-atom.php

    What I did was load the above files in my browser and then copy one of the xml entries. Then edit the same file on my hard disk by pasting that piece of code into the file, just above the line:-
    <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>

    Change the description and URL to reflect the static entry that you want displayed on top of your news feed. I don’t know what people used before Firefox live bookmarks but IMO the feature rocks. http://www.mozilla.org/products/firefox/live-bookmarks

Topic Closed

This topic has been closed to new replies.

About this Topic