修改自带HelloWorld插件,实现前台调用

public static function activate(){

//Typecho_Plugin::factory('admin/menu.php')->navBar = array('HelloWorld_Plugin', 'render');
Typecho_Plugin::factory('Widget_Archive')->header = array('HelloWorld_Plugin', 'render');

}
public static function render(){

// echo '<span class="message success">' .
// Typecho_Widget::widget('Widget_Options')->plugin('HelloWorld')->word . '</span>';
$helloword = Typecho_Widget::widget('Widget_Options')->plugin('HelloWorld')->word;
return $helloword;

}

前台调用

<?php echo HelloWorld_Plugin::render(); ?>