function widget_wp_related_posts($args) { if (is_single()) { extract($args); echo $before_widget; //echo $before_title . $options["related_posts_title"] . $after_title; $output = wp_rp_get_related_posts($before_title, $after_title); echo $output; echo $after_widget; } }
function wp_rp_add_related_posts_hook($content) { global $wp_rp_output, $post; $options = wp_rp_get_options(); if ($content != "" && $post->post_type === 'post' && ($options["on_single_post"] && is_single() || is_feed() && $options["on_rss"])) { if (!isset($wp_rp_output[$post->ID])) { $wp_rp_output[$post->ID] = wp_rp_get_related_posts(); } $content = str_replace('%RELATEDPOSTS%', '', $content); // used for gp $content = $content . $wp_rp_output[$post->ID]; } return $content; }
function wp_get_related_posts($before_title = '', $after_title = '') { return wp_rp_get_related_posts($before_title, $after_title); }