久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔

WordPress:WPMU List All Blogs Widget

來自站長百科
跳轉(zhuǎn)至: 導航、? 搜索

This code is the code needed to create a widget to show a list of all blogs. It is dependent on the plug-in List-All, that should be installed first. Create a blank text file named widget_list_all.php in your plugins folder, add the following php code. You should then be able to activate the List All plugin and the List-All-Blogs Widget on the plugins tab. Then look over in the presentation/widgets tab and you should have a new widget named List All Blogs Widget.

需要這個代碼,創(chuàng)建widget顯示所有博客的列表。取決于插件List-All,應(yīng)該先安裝這個插件。在你的插件文件夾中創(chuàng)建名為widget_list_all.php的空白文本文件,添加下面的php代碼。然后你就能夠激活插件標簽上的List All插件和List-All-Blogs Widget。然后查看呈現(xiàn)/widget標簽,你應(yīng)該有個新的稱為All Blogs Widget的widget。

 <?php
/*
Plugin Name: List-All-Blogs Widget
Plugin URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
Description: Creates a list of all blogs on a WPMU site as a widget, conversion from previous version based on code in http://www.erik-rasmussen.com/blog/2006/11/30/widgetize-anything/
Author: Unkown - last edited Iolaire McFadden 
Author URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
Version: 0.0.1
*/

function widget_list_all_blogs_init() {
	if ( !function_exists('register_sidebar_widget') )
		return;


	function widget_list_all_blogs($args) {
        extract($args);

        if(function_exists(list_all_wpmu_blogs)) {
                 echo $before_widget;

                 echo $before_title . 'All Blogs' . $after_title;
                        echo "<ul>\n";
                        list_all_wpmu_blogs('100', 'name', '<li>', '</li>', 'updated');
                        echo "</ul>\n";
                 echo $after_widget;
        } 
		else 
		{
                 echo "Error - function  list_all_wpmu_blogs not found";
        }
	}
	

    if ( function_exists('wp_register_sidebar_widget') ) // fix for wordpress 2.2.1
      wp_register_sidebar_widget(sanitize_title('Widgetize list all blogs' ), 'Widgetize list all blogs', 'widget_list_all_blogs', array(), 1);
    else
      register_sidebar_widget('Widgetize list all blogs', 'widget_list_all_blogs', 1);
}
add_action('plugins_loaded', 'widget_list_all_blogs_init');
?>










 <?php
/*
插件名: List-All-Blogs Widget
插件 URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
描述: 在WPMU上創(chuàng)建所有博客列表作為widget,從先前http://www.erik-rasmussen.com/blog/2006/11/30/widgetize-anything/上的代碼為基礎(chǔ),轉(zhuǎn)變
作者: 未知- 最后由 Iolaire McFadden 編輯
作者 URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
Version: 0.0.1
*/

function widget_list_all_blogs_init() {
	if ( !function_exists('register_sidebar_widget') )
		return;


	function widget_list_all_blogs($args) {
        extract($args);

        if(function_exists(list_all_wpmu_blogs)) {
                 echo $before_widget;

                 echo $before_title . 'All Blogs' . $after_title;
                        echo "<ul>\n";
                        list_all_wpmu_blogs('100', 'name', '<li>', '</li>', 'updated');
                        echo "</ul>\n";
                 echo $after_widget;
        } 
		else 
		{
                 echo "Error - function  list_all_wpmu_blogs not found";
        }
	}
	

    if ( function_exists('wp_register_sidebar_widget') ) // fix for wordpress 2.2.1
      wp_register_sidebar_widget(sanitize_title('Widgetize list all blogs' ), 'Widgetize list all blogs', 'widget_list_all_blogs', array(), 1);
    else
      register_sidebar_widget('Widgetize list all blogs', 'widget_list_all_blogs', 1);
}
add_action('plugins_loaded', 'widget_list_all_blogs_init');
?>