Display Blog Rules In Register Page In WordPress

Display Blog Rules In Register Page In WordPress
Display Blog Rules Register Page WordPress

In a forum, everybody must read the forum rules and accept it before registering. That is useful because it helps members to understand how the forum works. The idea, of course, can be applied to WordPress blog, too. We can display the blog rules or just the welcome text in the register page by using simple code as the following direction.

Open the functions.php file of your theme and paste this code into it:

add_action('register_form', 'my_rules');
function my_rules() {
    $html = '
        <div style="margin:10px 0;border:1px solid #ccc;padding:10px">
            <p style="margin:5px 0;font-weight:bold">By registering in ABC Blog, you must accept the following rules:</p>
            <p style="margin:5px 0">- Use the real email address that blog admins can contact you at anytime</p>
            <p style="margin:5px 0">- Don't post pornographic materials, unlisenced softwares, etc.</p>
        </div>
        ';
    echo $html;
}

You can see the result in the screenshot above. The code is self explained as it is, it just displays raw HTML string.

One disadvantage of this method is that it displays the text inside the register form, there is not much space for echoing strings as in the forum’s situation. So be brief and creative using it!

2 thoughts on “Display Blog Rules In Register Page In WordPress

  1. Tried to nice code with wordpress 3.3.1 but does not work, any idea how to do this nice trick with the latest WP version?

  2. I want to prepare the same comment page as same page like this,can anyone help me by giving proper code related to this type of page..plz help me..
    thanks in advance..

Comments are closed.

Newsletter

Subscribe to our newsletter to receive news and tutorials about WordPress and web development.

Meta Box - Create advanced WordPress custom fields and custom meta boxes with ease Download Now