How to hide text on my blog from not appearing in the RSS feed?

Discussion in 'HTML & Website Design' started by sharky, Feb 24, 2007.

  1. #1
    I am stumped on how to do this.

    I like to publish posts on my Wordpress blog and use the full feed format.

    In my posts I like to include a PHP generated list of relevant books to the subject I'm writing about from Amazon. The list is different on each post so I can't just include it in the theme template.

    Unfortunately the RSS feed chokes on this PHP code after a few posts and dies.

    So I'd like to exclude the PHP code from appearing in my RSS feed.

    Are there comment tags for RSS or something similar so I can hide the code in the RSS feed and but let it appear in the blog post on the web?

    Any suggestions appreciated.

    Cheers
     
    sharky, Feb 24, 2007 IP
  2. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #2
    In the PHP that generates the related books only do it if it's not the feed, e.g.
    
    if(!is_feed())
    {
        // Do book thing
    
    }
    
    PHP:
     
    dct, Feb 24, 2007 IP
  3. sharky

    sharky Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Awesome. The lightbulb just went on. Cheers dct!
     
    sharky, Feb 24, 2007 IP