SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RSS Feed Image Just Doesn't Work

    I don't really know what's going on here. I'm using self-hosted WordPress 2.6.1 and am trying to edit the feed-rss.php and feed-rss2.php files to allow for an RSS Favicon. The code I'm inserting is as follows:

    Code:
    <image>
        <title>Justin Cox's Mindless Chatter</title>
        <url>http://www.justincox.com/rss.jpg</url>
        <link>http://www.justincox.com</link>
        <width>128</width>
        <height>128</height>
        <description>Justin Cox's Mindless Chatter - http://www.justincox.com</description>
    </image>
    This is dropped inside the <channel> right before the <item> tag begins. I have tried hard coding this and using a WP plugin and cannot seem to get the stupid image to show up. I've tried using a .png and a .jpg image and still it doesn't work. I'm pretty much at a loss here. Hopefully someone can help.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,190
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    I have a WordPress blog and the favicon shows in my feedreader OK. I don't use any plugins for it, just the original unhacked core files. The source is
    Code XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0"
    	xmlns:content="http://purl.org/rss/1.0/modules/content/"
    	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    	xmlns:dc="http://purl.org/dc/elements/1.1/"
    	xmlns:atom="http://www.w3.org/2005/Atom"
    	>
     
    <channel>
    	<title>the Mittineague Blog</title>
    	<atom:link href="http://www.mittineague.com/blog/feed/" rel="self" type="application/rss+xml" />
    	<link>http://www.mittineague.com/blog</link>
    	<description>Random rants and rambling ons, Observations and Opinion, Information and Instigation</description>
    	<pubDate>Sun, 03 Aug 2008 04:03:06 +0000</pubDate>
    	<generator>http://wordpress.org/?v=2.6</generator>
    	<language>en</language>
    			<item>
    		<title>WordPress Functions 2.6</title>
    		<link>http://www.mittineague.com/blog/2008/08/wordpress-functions-26/</link>
    		<comments>http://www.mittineague.com/blog/2008/08/wordpress-functions-26/#comments</comments>
    		<pubDate>Sun, 03 Aug 2008 03:20:48 +0000</pubDate>
    		<dc:creator>Mittineague</dc:creator>
     
    		<category><![CDATA[Scripting]]></category>
     
    		<category><![CDATA[functions]]></category>
     
    		<category><![CDATA[WordPress]]></category>
     
    		<guid isPermaLink="false">http://www.mittineague.com/blog/?p=64</guid>
    		<description><![CDATA[Visit Mittineague - WordPress has changed quite a bit since version 2.3, including a net increase of 12 classes and
    577 functions.
    Again, I used a script that searches WordPress files using regular expressions to find Classes and Functions.
    64 PHP Classes and 2,116 PHP Functions were found.
    The PHP Classes and Functions of WordPress 2.6
    * Note *
    The list [...]]]></description>
    		<wfw:commentRss>http://www.mittineague.com/blog/2008/08/wordpress-functions-26/feed/</wfw:commentRss>
    		</item>
    .....
    As you can see, no image tag for the favicon. I have the "favicon.ico" file (named favicon, not rss or anything else, and not jpg, gif, or png, but ico), in the site's top level public directory. The feedreader (and browsers to site pages) find it and use it "automatically" although for pages I also use a
    HTML Code:
    <link rel='shortcut icon' href='./favicon.ico' />
    tag.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'll be...

    Here I am trying to make the thing 100&#37; harder than it really is. I had my favicon named icon.ico. Who knew that's all it'd take. Thanks for clearing that up for me.

  4. #4
    SitePoint Enthusiast CheapSEO's Avatar
    Join Date
    Aug 2008
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RSS_PHP is a RSS Parser and XML Parser for PHP 5+, utilising the DOM to parse any valid XML Document including RSS, with provisional support for ATOM feeds.

    This RSS Parser was created to be as simple as possible. Here's a working example which will parse a full RSS feed, it'll also automatically convert the XML Document to UTF-8 from any other encoding:
    <?php

    $rss = new rss_php;

    $rss->load('http://rssphp.net/rss.xml');

    $items = $rss->getItems(); #returns all rss items

    ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •