Simple Pie?

Discussion in 'Blogging' started by hawke, Apr 14, 2010.

  1. hawke

    hawke Power Member

    Joined:
    Nov 14, 2008
    Messages:
    644
    Likes Received:
    534
    Location:
    Ohio
    I'm getting an invalid header error when I try to install this plugin for wordpress. Wether I install it as a theme or plugin, neither way works... any ideas?
     
  2. Namun

    Namun Junior Member

    Joined:
    Sep 13, 2008
    Messages:
    137
    Likes Received:
    176
    Just upload it as plugin but don't activate it, on your header.php file from your theme folder just add this line

    Code:
    <?php include_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/simplepie-core/simplepie.inc'; ?>
    
    Then call the simplepie function anywhere on your theme files like ..

    Code:
    <?php
    $twitter = new SimplePie('http://search.twitter.com/search.atom?q=keyword');
    $twitter->strip_htmltags(array_merge($twitter->strip_htmltags, array('b', 'a')));
    $twitter->enable_cache(true);
    $twitter->set_cache_duration(86400);
    $twitter->init();
    $twitter->handle_content_type();
    foreach ($twitter->get_items(0, 5) as $item):
    echo $item->get_description();
    endforeach;
    ?>
    
    etc
     
    • Thanks Thanks x 1
    Last edited: Apr 14, 2010