如何向Wordpress注册页面添加更多信息?
问题描述:
I am wanting to add a small amount of text to the websites registration page, but as simple as this may sound I am having trouble. The website uses BuddyPress & runs on the Storefront Theme.
The image shows where I am wanting to add the text. I would imagine this could be done from inside my functions.php but unsure how to do this. Any advice?
答
I would imagine this could be done from inside my functions.php but unsure how to do this.
Yes, that's correct.
And here's a code snippet that will add the custom message as you highlighted in the screen capture you provided.
(the HTML code is just an example; feel free to edit the class
, wrap the P
in a DIV
, etc.)
// Add custom HTML before the "Complete Sign Up" button in the "Profile Details"
// column on the BuddyPress registration page.
add_action( 'bp_signup_profile_fields', function() {
// Start editing below.
?>
<p class="notice-check-inbox">
Please remember to check your emails and confirm registration for a
<strong>10% discount voucher</strong>!
</p>
<?php
// End editing.
} );