Could anyone show me how to make website like popurl by using simplepie. I want it to be nofollow on each link and open in a new window. Thanks in advance.
if you use Owprdpress there's a ready-to-use function. if you use your own PHP you can use the API to pull content. read here for more info about API http://simplepie.org/wiki/ and some tutorial here http://www.tomconstant.com/2010/02/20/the-google-buzz-api-with-php-and-simplepie-aka-just-atom-feeds/
you din't need plugin to deal with simplepie in wordpress 2.8 and above. just need to add the function to the page you desired to add the feed.
here's simple usage for single feed. for muntiple feed, you need to declare array on function fetch_feed: <?php // Get RSS Feed(s) include_once(ABSPATH . WPINC . '/feed.php'); // Get a SimplePie feed object from the specified feed source. $rss = fetch_feed('http://www.somesite.com/feed/'); // Figure out how many total items there are, but limit it to 5. $maxitems = $rss->get_item_quantity(5); // Build an array of all the items, starting with element 0 (first element). $rss_items = $rss->get_items(0, $maxitems); ?> <?php if ($maxitems == 0) echo '<li>No items.</li>'; else // Loop through each feed item and display each item as a hyperlink. foreach ( $rss_items as $item ) : ?> <h3><a href='<?php echo $item->get_permalink(); ?>' //the rss post title as link title='<?php echo $item->get_title(); ?>'> //use content as title for link <?php echo $item->get_title(); ?></a></h3> <p><?php echo $item->get_date('j F Y | g:i a'); ?></p> //date and time of post here <?php endforeach; ?> PHP: feel free to remove comment if it trigger any error
change this line: $rss = fetch_feed('http://www.somesite.com/feed/'); PHP: to an array $rss = fetch_feed(array( 'http://somesite.com/feed/', 'http://anothersite.com/feed/', 'and so on')); PHP:
I have more questions here. How do I know if this follow or nofollow? since I would like it to be nofollow. thanks in advance.