【发布时间】:2012-01-29 23:33:05
【问题描述】:
如何在 WordPress 中创建全宽仪表板小部件?
我想在 WordPress 3.3 中创建一个新的“欢迎”小部件。
该插件位于wp_welcome_panel() 中的dashboard.php 中,但我不知道它们是如何全角显示的。
他们在所有小部件所在的主 div 之外创建了一个 div“欢迎面板”,“dashboard-widgets-wrap”:
<div id="welcome-panel" class="welcome-panel"></div>
<div id="dashboard-widgets-wrap">
<div id="dashboard-widgets" class="metabox-holder">
<div id="postbox-container-1" class="postbox-container" style="width:50%;">
<div id="postbox-container-2" class="postbox-container" style="width:50%;">
<div id="postbox-container-3" class="postbox-container" style="display:none;width:50%;">
<div id="postbox-container-4" class="postbox-container" style="display:none;width:50%;">
</div>
我怎样才能做到这一点?
编辑
我在第 90 行的 wp-admin/index.php 中找到了这个:
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php wp_welcome_panel(); ?>
<div id="dashboard-widgets-wrap">
<?php wp_dashboard(); ?>
<div class="clear"></div>
</div><!-- dashboard-widgets-wrap -->
</div><!-- wrap -->
所以他们直接插入代码。
我看到的唯一解决方案可能是使用 jQuery?
还有其他选择吗?
全角小部件对于在您自己的主题顶部添加包含更新或确证信息或任何内容的内容非常有用。
【问题讨论】:
标签: wordpress widget dashboard