Show in Sidebar (2 posts)

  1. tyok
    Posted 8 years ago #

    Hi, could you add a feature so we could choose to show the related posts in sidebar-as a widget-instead of below the post?

    I've managed to achieve that by manually editing yarpp.php:
    1. I commented this line:
    2. Then I added this:

    function widget_yarpp_init() {
    	if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
    	function widget_yarpp($args) {
    		global $wpdb, $post, $user_level;
    		if (get_option('yarpp_auto_display') and is_single()) {
    				echo $before_widget;
    				    	echo $before_title . 'Recent Posts' . $after_title;
    					echo yarpp_related(array('post'),array());
    				echo $after_widget;
    	register_sidebar_widget(__('YARPP'), 'widget_yarpp');
    add_action('plugins_loaded', 'widget_yarpp_init');

    But it'd be nice if there is an option for that in the admin panel.

    Sorry if I ask too much, and thanks for this splendid plugin!

  2. @tyok — Thanks for the suggestion! I'll make sure to put widget-ization in 2.0... do you mind if I use your code as its base, with due credit? Email me and let me know.

    Thanks again,

Topic Closed

This topic has been closed to new replies.

About this Topic