Displaying recent Wordpress posts in Pligg

In this tutorial I will show you how to start integrating your Wordpress blog into your Pligg install by displaying your recent blog posts in your Pligg sidebar.

One way to add to your Pligg install is to add a Wordpress blog. The blog can be used for promoting certain site features, posting top 10 lists or posting site news. A blog is a great way to increase your site’s traffic and exposure.

Integrate Pligg and WordpressIntegrate Pligg and Wordpress

 

I added a Wordpress blog to FAQPAL a couple of months ago and it has certainly helped.

One way to integrate the blog is to display your recent blog posts in the Pligg sidebar, this will again add to your blog traffic and ultimately your Pligg install traffic.

In order to do this, you will need to download the latest version of Simplepie, once downloaded, unzip it, and upload it to your 3rdparty folder. It will take approximately 5 minutes to upload, as it is a huge folder.

SimplePie

Now in order to make this work, you must choose a .php file to add the following code, I have used sidebar_stories_u.php (using v9.9.5) and added it to the bottom.

In Wistie open libs/sidebarstories.php, add to the bottom:

< ?php
$feed_url = ‘http://www.YOURSITE.com/blog/feed/’;
$max_items = 5;
 
//Load SimplePie
include ‘http://www.YOURSITE.com/3rdparty/simplepie/includes/simplepie.inc’;
 
//Fetch the RSS feed
$feed = new SimplePie($feed_url);
 
//Check for errors
if ($feed->error())
        echo ‘Error : ‘,$feed->error();
 
//Output up to $max_items posts
foreach ($feed->get_items(0, $max_items) as $item): ?>
        <div class="item">
                <h3 class="title"><a href="<?php echo $item->get_permalink(); ?>">< ?php echo $item->get_title(); ?></a></h3>
                < ?php echo $item->get_description(); ?>
                <p><small>
                Posted  < ?php if ($author = $item->get_author()){ echo ‘ by ‘.$author->get_name(); }?>
                on < ?php echo $item->get_date(‘j F Y | g:i a’); ?>
                </small></p>
        </div>
< ?php
endforeach;
?>

In the above code, make sure you change the domain to match yours, as well make sure the path to your blog is correct.

The code above will display “5″ of your recent entries, which you can change by altering:

$max_items = 5;

it will also display the excerpt for the each blog post, author name and date. I chose to only display the title, so you can remove the following:

                < ?php echo $item->get_description(); ?>
                <p><small>
                Posted  < ?php if ($author = $item->get_author()){ echo ‘ by ‘.$author->get_name(); }?>
                on < ?php echo $item->get_date(‘j F Y | g:i a’); ?>
                </small></p>

That’s it. This module will work on both v9.9.5 and the latest Pligg build. You will need to do whatever styling you want in order to blend it in with the rest of your site.

You can see a working example on FAQPAL, check out the blog as well.

As always, any issues leave me a comment below.

Will you be using this on your Pligg install?

If you enjoyed this post, make sure you subscribe to my RSS feed!

  • If you have hosted your Wordpress blog, then I sugges you to get the AdSense plugin from the Extend section of Wordpress.
  • How can I let posts go to different page, for example, I have 'articles' tab and ''events' tab. I want articles postings go to articles section and I want events postings go to events section.
  • I agree with wedding decorations, that would be really great indeed.
  • Such a list would be very usefull for expanding the Pligg plugin. It occurs to me that it would also be helpfull for spammers, which is sad and depressing. So. Is there such a list? And if not, anyone who wants to have their Pligg site included when I release a English/multisite version of this Widget?
  • @wedding try using search engine, or go and check directly on wordpress main website.
  • I'm looking for a Word press theme that won't display posts until people search for them. I want it to look very Google like is this possible.
  • Does Tagging my Wordpress posts help with search engines? Like will I get more visitors because I tag every post in a blog? I am curious because I have not tagged any posts in my blog yet.
  • nice Gadgets to add in the blogs for wordpress plugging
  • sri
    do you offer any services to help me ?? i m bit confused to work on it may be i need some one to help me
  • There is an option in wordpress admin that you can either use the rich text interface or enter html interface. No plug-in needed. Check out admin panel where you enter your post, to locate it.
blog comments powered by Disqus