wordpress 自定义
Do you want to create your own custom widgets in WordPress? Widgets allow you to add non-content elements into a sidebar or any widget-ready area of your website.
您要在WordPress中创建自己的自定义小部件吗? 窗口小部件允许您将非内容元素添加到侧边栏或网站的任何窗口小部件就绪区域。
You can use widgets to add banners, advertisements, newsletter sign up forms, and other elements to your website.
您可以使用小部件向您的网站添加横幅,广告,新闻通讯注册表单和其他元素。
In this article, we will show you how to create a custom WordPress widget, step by step.
在本文中,我们将逐步向您展示如何创建自定义WordPress小部件。
Note: This tutorial is for DIY WordPress users who are learning WordPress development and coding.
注意:本教程适用于正在学习WordPress开发和编码的DIY WordPress用户。
什么是WordPress小部件? (What is a WordPress Widget?)
WordPress widgets contain pieces of code that you can add to your website’s sidebars or widget-ready areas.
WordPress小部件包含一些代码片段,您可以将其添加到网站的侧边栏或可用于小部件的区域。
Think of them as modules that you can use to add different elements by using a simple drag and drop interface.
将它们视为模块,您可以使用简单的拖放界面来添加不同的元素。
By default, WordPress comes with a standard set of widgets that you can use with any WordPress theme. See our beginner’s guide on how to add and use widgets in WordPress.
默认情况下,WordPress带有一组标准的小部件,您可以将其与任何WordPress主题一起使用。 请参阅我们的初学者指南, 了解如何在WordPress中添加和使用小部件 。
WordPress also allows developers to create their own custom widgets.
WordPress还允许开发人员创建自己的自定义小部件。
Many premium WordPress themes and plugins come with their own custom widgets that you can add to your sidebars.
许多高级WordPress主题和插件都带有它们自己的自定义小部件,您可以将其添加到侧边栏中。
For example, you can add a contact form, a custom login form, or a