SimplePie 1.3.1 is now available. Upgrade now!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie » get_permalink()



class SimplePie {
	get_permalink ()

Returns the first link available with a relationship of “alternate”. Identical to passing 0 to get_link().


  • Available since SimplePie 1.0.
  • Previously existed as get_feed_link() since SimplePie Preview Release.
  • Previously existed as get_feed_permalink() since SimplePie 0.8.


Loop through each item and do something with each

$feed = new SimplePie('');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en">
	<title>Sample SimplePie Page</title>
	<div class="header">
		<h1><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a></h1>
		<p><?php echo $feed->get_description(); ?></p>
	<?php foreach ($feed->get_items() as $item): ?>
		<div class="item">
			<h2 class="title"><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
			<?php echo $item->get_description(); ?>
			<p><small>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></small></p>
	<?php endforeach; ?>

See Also

reference/simplepie/get_permalink.txt · Last modified: 2011/03/05 19:56 (external edit)