编辑“WordPress:WPMU List All Blogs Widget

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1行: 第1行:
This code is the code needed to create a widget to show a list of all blogs.  It is dependent on the plug-in [http://wpmudev.org/project/List-All 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.
需要这个代码,创建widget显示所有博客的列表。取决于插件[http://wpmudev.org/project/List-All List-All],应该先安装这个插件。在你的插件文件夹中创建名为widget_list_all.php的空白文本文件,添加下面的php代码。然后你就能够激活插件标签上的List All插件和List-All-Blogs Widget。然后查看呈现/widget标签,你应该有个新的称为All Blogs Widget的widget。
<pre>
<pre>
  <?php
  <?php
第11行: 第7行:
Author: Unkown - last edited Iolaire McFadden  
Author: Unkown - last edited Iolaire McFadden  
Author URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
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');
?>
</pre>
<pre>
<?php
/*
插件名: List-All-Blogs Widget
插件 URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
描述: 在WPMU上创建所有博客列表作为widget,从先前http://www.erik-rasmussen.com/blog/2006/11/30/widgetize-anything/上的代码为基础,转变
作者: 未知- 最后由 Iolaire McFadden 编辑
作者 URI: http://codex.wordpress.org/WPMU_List_All_Blogs_Widget
Version: 0.0.1
Version: 0.0.1
*/
*/
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)