/**
  * Widget output
  */
 public function widget($args, $instance)
 {
     $title = isset($instance['title']) ? $instance['title'] : NULL;
     $post = get_queried_object();
     if (empty($post->ID)) {
         return;
     }
     //end if
     $query = go_related()->get_related_posts($post->ID);
     if (!$query) {
         return;
     }
     //end if
     echo $args['before_widget'];
     include __DIR__ . '/templates/related-stories.php';
     echo $args['after_widget'];
 }
Example #2
0
<?php

/*
 * Plugin Name: Gigaom Related
 * Description: Adds functionality for digging up related content
 * Author:      Gigaom Network
 * Author URI:  http://gigaom.com/
 * License: GPLv2
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 */
require_once __DIR__ . '/components/class-go-related.php';
go_related();