February 6, 2007

PHP scripts for RSS

Filed under: CSS, HTML, Web Design, WordPress — Douglas T @ 7:45 am

I’ve recently been playing with a free PHP Script. I’m incorporating a little of the dynamic content of the blog into the main page using a PHP script pulling in the RSS feed. It’s a very user friendly set-up. The documentation leaves a little to be desired, and the sample template had to be completely redone for my use, but the actual script is quite impressive. If you’re looking for this sort of thing, it’s well worth your time. The superior quality of the script far outweighs the negatives of the documentation and template.

To get the results I wanted, I changed the template file to PHP and removed all of the extraneous coding. Changing the template to PHP allowed me to remove a lot of the HTML in the template, making for cleaner ocde when it was pulled into the home page. Then all that was left was to add the proper CSS selectors and it was ready to go.

4 Comments »

  1. Sounds like a cool plug-in. Does the PHP process the RSS into HTML or do you just apply CSS styles to the raw XML in the feed?

    I run an XSL transform on RSS, RDF and Atom feeds to convert them to HTML, (on my newsfeed pages) but I don’t convert the inner content of the items.

    Sometimes the newsfeeds have mal-formed HTML in them, and end up breaking validation for my site, or they contain script that plugs in advertising.

    Comment by Perri Nelson — February 6, 2007 @ 11:52 am

  2. There appears to be several ways to do it and I’ve only tried one so far. You assign formatting to fields such as title, time, date, etc. In my case I applied CSS. Then the script drops the contents of the RSS into the fields. The sample template used tables for layout, but switched mine to divs, to match my site formatting. I also, as I mentioned, made mine PHP so I could strip out the head tags and make the final product valid html.

    You can adjust the fields you use, by just moving them around in the template, or removing them altogether. For instance I removed the blog title and description, since it was my own. If I was loading a feed from another site, I could have left that in.

    Comment by Douglas T — February 6, 2007 @ 12:11 pm

  3. [...] place where I try out ideas before I place them into the higher traffic sites that I maintain. The PHP scripts for RSS for instance, that I tried out here not too long ago has since been used in several other places [...]

    Pingback by Thoughts on Design » Who am I to lecture anybody about graphic design? — February 21, 2007 @ 8:38 am

  4. [...] Thoughts on Design PHP scripts for RSS I’ve recently been playing with a free PHP Script. I’m incorporating a little of the dynamic content of the blog into the main page using a PHP script pulling in the RSS feed. It’s a very user friendly set-up. The documentation leaves… [...]

    Pingback by Cracking Down on Trackback Spam Mid-Week Open Trackbacks | Adam's Blog — October 16, 2007 @ 12:02 am

RSS feed for comments on this post. TrackBack URI

Leave a comment