1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Pie?

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

  1. hawke

    hawke Power Member

    Joined:
    Nov 14, 2008
    Messages:
    644
    Likes Received:
    533
    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:
    136
    Likes Received:
    175
    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