wordpress 自定义_如何在WordPress中添加自定义仪表板小部件

wordpress 自定义

There are tons of new themes coming out for WordPress every day, but none of them seems to utilize this feature. WordPress developers should add custom dashboard widget with support information. In this article we will show you how you can customize dashboard widgets in WordPress.

每天都有大量关于WordPress的新主题出现,但是似乎没有一个主题可以利用此功能。 WordPress开发人员应添加带有支持信息的自定义仪表板小部件。 在本文中,我们将向您展示如何在WordPress中自定义仪表板小部件。

Simply add this code to your theme’s functions.php file or a site-specific plugin.

只需将此代码添加到主题的functions.php文件或特定于站点的插件中即可 。


add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
 
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;

wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}

function custom_dashboard_help() {
echo '

Welcome to Custom Blog Theme! Need help? Contact the developer here. For WordPress Tutorials visit: WPBeginner

'; }

Remember to change the email and add other useful information.

记住要更改电子邮件并添加其他有用的信息。

This code can be very helpful when creating custom themes for clients.

为客户端创建自定义主题时,此代码可能非常有用。

Result:

结果:

wordpress 自定义_如何在WordPress中添加自定义仪表板小部件_第1张图片

We hope this article helped you learn how to add custom dashboard widget in WordPress. You may also want to see our guide on how to remove unnecessary items from WordPress admin area.

我们希望本文能帮助您学习如何在WordPress中添加自定义仪表板小部件。 您可能还想查看有关如何从WordPress管理区域中删除不必要项目的指南。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/

wordpress 自定义

你可能感兴趣的:(java,python,php,wordpress,vue,ViewUI)