如何在WordPress边栏中添加登录表单

Do you want to add a login form to your WordPress sidebar? A login form in the WordPress sidebar allows users to quickly login from anywhere on your website. In this article, we will show you how to easily add a custom login form to your WordPress sidebar.

您是否要向WordPress侧边栏添加登录表单? WordPress侧边栏中的登录表单使用户可以从您网站上的任何位置快速登录。 在本文中,我们将向您展示如何轻松地将自定义登录表单添加到WordPress侧边栏。

Adding a login form to your WordPress sidebar
什么时候以及为什么需要WordPress中的自定义登录表单? (When and Why Do You Need a Custom Login Form in WordPress?)

If you run a membership websites, online stores, or sell online courses, then you likely need your users to login to perform certain actions.

如果您运行会员网站在线商店出售在线课程 ,则可能需要用户登录才能执行某些操作。

Since, the sidebar appears throughout a website, it makes the login form more noticeable and easily accessible from every page on the site. Adding a login form to your WordPress sidebar makes it easy for users to quickly login to their accounts which boost engagement.

由于侧边栏出现在整个网站中,因此使登录表单更加引人注目,并且可以从网站的每个页面轻松访问。 将登录表单添加到WordPress侧边栏后,用户可以轻松地快速登录其帐户,从而提高参与度

That being said, let’s take a look at how to easily add a login form in your WordPress sidebar.

话虽如此,让我们看一下如何轻松地在WordPress边栏中添加登录表单。

方法1:使用补充工具栏登录插件在补充工具栏中添加登录表单 (Method 1: Adding a Login Form in Sidebar Using Sidebar Login Plugin)

First thing you need to do is install and activate the Sidebar Login plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活补充工具栏登录插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to go to Appearance » Widgets page in your WordPress admin area. Simply drag and drop the Sidebar Login widget in your sidebar widget area.

激活后,您需要转到WordPress管理区域中的外观»小部件页面。 只需将侧边栏登录小部件拖放到侧边栏小部件区域。

Drag widget in sidebar

It will automatically add a login form in your WordPress sidebar. If you want to customize the login form settings, then you can edit the widget settings accordingly.

它将自动在您的WordPress边栏中添加一个登录表单。 如果要自定义登录表单设置,则可以相应地编辑小部件设置。

You can add logged-out title, custom links, enable lost password and register links, display Remember me option, and more.

您可以添加注销的标题,自定义链接,启用丢失的密码和注册链接,显示“ 记住我”选项等等。

Sidebar login settings

Once you are satisfied with these settings, don’t forget to click on the Save button. After that, you can visit your website to see a custom login form in action.

对这些设置感到满意之后,请不要忘记单击“ 保存”按钮。 之后,您可以访问您的网站以查看正在使用的自定义登录表单。

Sidebar login form
方法2:使用WPForms插件添加自定义登录表单 (Method 2: Adding a Custom Login Form Using WPForms Plugin)

WPForms is the most popular WordPress form plugin. The premium version of WPForms allows you to easily create WordPress login and registration forms with custom fields.

WPForms是最流行的WordPress表单插件 。 WPForms的高级版本使您可以轻松地使用自定义字段创建WordPress登录和注册表单。

If you want to create a custom login form or registration form that has custom fields, and embed it in other areas of your website like sidebar, custom page, etc, then you need WPForms.

如果要创建具有自定义字段的自定义登录表单或注册表单,并将其嵌入到网站的其他区域(如侧边栏,自定义页面等)中,则需要WPForms。

WPBeginner users can use the WPForms Coupon: SAVE20 to get 20% off on their purchase.

WPBeginner用户可以使用WPForms优惠券SAVE20享受20%的购买折扣。

First thing you need to do is install and activate the WPForms plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活WPForms插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to visit WPForms » Settings page to enter your license key. You can get your license key from your WPForms account on their website.

激活后,您需要访问WPForms»设置页面以输入许可证密钥。 您可以从其网站上的WPForms帐户获取许可证密钥。

WPForms license

After verification, you need to go to WPForms » Addons page. From here you need to scroll down to the User Registration Addon and click on the Install Addon button.

验证之后,您需要转到WPForms»Addons页面。 从这里,您需要向下滚动到User Registration Addon ,然后单击Install Addon按钮。

User registration addon

Once installed, you need to click on the Activate button to start using this addon.

安装完成后,您需要单击“ 激活”按钮以开始使用此插件。

You are now ready to create a custom WordPress login form. Simply visit WPForms » Add New page to launch the WPForms builder.

您现在准备创建自定义WordPress登录表单。 只需访问WPForms»添加新页面以启动WPForms构建器。

First, you need to enter a form name and then select the built-in User Login Form template.

首先,您需要输入一个表单名称,然后选择内置的“ 用户登录表单”模板。

Login form template

It will display the login fields pre-loaded in your form. You can click on a field to edit it or add new fields from the left column.

它将显示表单中预加载的登录字段。 您可以单击一个字段进行编辑或从左栏中添加新字段。

Login form fields

After that, head over to Settings tab and click on the Confirmation section. This is where you need to define what to do once a user successfully login to your site.

之后,转到“设置”选项卡,然后单击“ 确认”部分。 在这里,您需要定义用户成功登录到您的网站后的处理方式。

Confirmation section

The options include a message, a custom page, or a redirect URL to any page on your site. Ideally, you would want to redirect users to a page once they are logged in. This could be your homepage or any other page on your website.

这些选项包括消息,自定义页面或指向您网站上任何页面的重定向URL。 理想情况下,您希望在用户登录后将其重定向到页面。这可以是您的主页,也可以是网站上的任何其他页面。

Your login form is now ready. Next, you can add it in your WordPress sidebar.

您的登录表单现已准备就绪。 接下来,您可以将其添加到WordPress边栏中。

Visit Appearance » Widgets page in your WordPress admin area. On this page, you need to drag and drop WPForms widget in sidebar widget area of your site.

在WordPress管理区域中访问外观»小部件页面。 在此页面上,您需要将WPForms小部件拖放到站点的侧边栏小部件区域中。

Drag and drop WPForms widget

You can add a title to display above the login form and select your form in the drop-down. Don’t forget to click on the Save button to store your widget settings.

您可以添加标题以显示在登录表单上方,然后在下拉菜单中选择您的表单。 不要忘记单击“ 保存”按钮来存储小部件设置。

Select login form

You can also use WPForms to create a custom user registration form with anti-spam features.

您还可以使用WPForms创建具有反垃圾邮件功能的自定义用户注册表单

If you want to embed the custom login form on a post or page, then you can do so by using the WPForms shortcode.

如果要将自定义登录表单嵌入到帖子或页面上,则可以使用WPForms短代码来实现。

We hope this article helped you learn how to add a login form in your WordPress sidebar. You may also want to see our step by step guide on how to create a WordPress login popup modal which will allow users to login without leaving the page they are viewing.

我们希望本文能帮助您学习如何在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视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-add-a-login-form-in-your-wordpress-sidebar/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值