Display your latest Google+ content on your WordPress blog

22
Oct

There are times when you may wish to display your latest Google+ content on your WordPress powered blog. This code snippet demonstrates how to display your latest Google+ posts.

Google+ Overview

Google+ makes connecting on the web more like connecting in the real world. Share your thoughts, links and photos with the right circles. Use easy, spontaneous video chat to strike up conversations with as many as nine people at once. Get everyone on the same page with fast, simple group chat. We’re very excited about the new approach to sharing that we’ve created through Google+, but this is really just the beginning.

Display the Google+ content

To display the Google+ content, you will need to get your hands a little dirty and modify your theme template files.

Navigate to wp-content -> themes -> your-curent-theme and open the theme file you wish to modify.
Add the following code where you want to display your latest Google+ content.
Don’t forget to put your Google+ ID on line 3.

1
2
3
4
5
6
7
8
<?php
include_once(ABSPATH.WPINC.'/rss.php');
$googleplus = fetch_feed("http://plusfeed2.appspot.com/104961845171318028721"); // Replace 104961845171318028721 with your own Google+ ID
echo '<a href="';
echo $googleplus->items[0]['link']; echo '">';
echo $googleplus->items[0]['summary'];
echo '';
?>
<?php
include_once(ABSPATH.WPINC.'/rss.php');
$googleplus = fetch_feed("http://plusfeed2.appspot.com/104961845171318028721"); // Replace 104961845171318028721 with your own Google+ ID
echo '<a href="';
echo $googleplus->items[0]['link']; echo '">';
echo $googleplus->items[0]['summary'];
echo '';
?>

That’s it! Simple

Be sure to check out our other great WordPress Code Snippets and WordPress Articles.
Enjoy this article? If so, we would love to hear your thoughts in the comments below

 

Related Blog Posts

Leave a Reply