Skip to:
Content
Pages
Categories
Search
Top
Bottom

Newbie help – profiles and layout through themes

  • @mattconway

    Participant

    Hello,

    My site http://www.walthamforestforum.org is coming together OK. I’m using the 2014 theme. However I’ve got a couple of things I am stuck on and wondered if anyone could help me.

    A – I would like new users to be able to register themselves, but with more detail than the standard sign up form allows, i.e. a few custom fields (that will hopefully show up everytime they post) and a recaptcha field. The Profile Builder plug in looks quite good but a bit expensive I think for such a simple requirement. Do some themes have better register pages built in?

    A – I’m not too keen on the narrow width of the forums, Could anyone recommend some themes that work well with bbpress on different platforms to maximise available width of display?

Viewing 5 replies - 1 through 5 (of 5 total)
  • @robin-w

    Moderator

    1.
    The following if added to your functions file will add fields, you can alter the coding as needed

    //add code for adding first and last name to registration
    
    //1. Add a new form element...
        add_action('register_form','myplugin_register_form');
        function myplugin_register_form (){
            $first_name = ( isset( $_POST['first_name'] ) ) ? $_POST['first_name']: '';
    		$last_name = ( isset( $_POST['last_name'] ) ) ? $_POST['last_name']: '';
            ?>
    		<p>
    		<label for="first_name"><?php _e('First Name  as people call you eg Dave','mydomain') ?><br />
                    <input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr(stripslashes($first_name)); ?>" size="25" /></label>
            </p>
    		<p>
                <label for="last_name"><?php _e('Last Name','mydomain') ?><br />
                    <input type="text" name="last_name" id="last_name" class="input" value="<?php echo esc_attr(stripslashes($last_name)); ?>" size="25" /></label>
            </p>
            <?php
        }
    
        //2. Add validation. In this case, we make sure first_name is required.
        add_filter('registration_errors', 'myplugin_registration_errors', 10, 3);
        function myplugin_registration_errors ($errors, $sanitized_user_login, $user_email) {
    
            if ( empty( $_POST['first_name'] ) )
                $errors->add( 'first_name_error', __('<strong>ERROR</strong>: You must include a first name.','mydomain') );
    		if ( empty( $_POST['last_name'] ) )
                $errors->add( 'last_name_error', __('<strong>ERROR</strong>: You must include a last name.','mydomain') );
    			
    
            return $errors;
        }
    
        //3. Finally, save our extra registration user meta.
        add_action('user_register', 'myplugin_user_register');
        function myplugin_user_register ($user_id) {
            if ( isset( $_POST['first_name'] ) )
                update_user_meta($user_id, 'first_name', $_POST['first_name']);
    		if ( isset( $_POST['last_name'] ) )
                update_user_meta($user_id, 'last_name', $_POST['last_name']);
        }
    

    Plenty of captcha plugins – just google ‘wordpress plugin captcha’

    If you’d like to specify your req’s further, I’ll try to help.

    2. no need to change theme, just add the following to your css file

    .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content .entry-meta, .page-content {
      max-width: 100% !important;
    }

    Functions files and child themes – explained !

    @robkk

    Moderator

    @mattconway

    – I’m not too keen on the narrow width of the forums, Could anyone recommend some themes that work well with bbpress on different platforms to maximise available width of display?

    i have a 2014 child theme i created that doesnt have the narrow width, might upload to github then later wordpress theme repository late for download or something.

    @mattconway

    Participant

    Thanks for your replies. Robin, thank you very much, especially for your link at the bottom pointing me in the right direction to set up a child theme. I feel my understanding has come on enormously. I also have a nice wide space for the forum answers!

    @robin-w

    Moderator

    Great – glad to have helped !

    @jobhaha

    Participant

    Great Thyank you..

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar