首页>文档>Astra教程>如何在我的帐户登录页面添加其他内容

此组别内的文章

需要支持?

如果通过文档没办法解决您的问题,请提交工单获取我们的支持!

如何在我的帐户登录页面添加其他内容

改善 WooCommerce 商店的用户体验通常需要进行定制,尤其是在“我的帐户”登录页面上。

本文档将引导您完成使用 WordPress 中的 Astra 子主题在“我的帐户”页面上的登录和注册表单中添加额外内容的步骤。

如何在我的帐户登录页面添加其他内容

在继续操作之前,请确保已安装并配置 WordPress,并且已激活 WooCommerce 插件。此外,请确保已设置子主题以在主题更新期间保护您的修改。

安装并激活子主题后,转到外观 > 主题文件编辑器,找到子主题。打开子主题内的 functions.php 文件进行代码自定义。

接下来,将提供的代码片段复制并粘贴到 functions.php 文件的末尾。

// Add content to the login form
add_action('woocommerce_login_form_start','astra_theme_add_login_text');
  
function astra_theme_add_login_text() {
    echo '<h3 class="bb-login-subtitle">Registered Customers</h3><p class="bb-login-description">If you possess an account with us, please sign in by entering your email address.</p>';
}

// Add content to the registration form
add_action('woocommerce_register_form_start','astra_theme_add_reg_text');
  
function astra_theme_add_reg_text() {
    echo '<h3 class="bb-register-subtitle">New Customers</h3><p class="bb-register-description">Sign up with our store to streamline your shopping experience. Enjoy faster checkout processes, store multiple shipping addresses, and conveniently view and track your orders--all within your account. Unlock additional benefits and make the most of your shopping journey.</p>';
}

然后,单击更新文件按钮保存 functions.php 文件。

如何在我的帐户登录页面添加其他内容-HEIWP-外贸建站

添加的内容现在应该显示在登录和注册表单上。您可以访问“我的帐户”页面查看更改。

如何在我的帐户登录页面添加其他内容-HEIWP-外贸建站

通过执行这些步骤,您已成功自定义 WooCommerce 商店中的“我的帐户”登录页面。您可以根据商店的设计偏好随意调整 HTML 内容和样式。

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
搜索