Then, place the file you created with the above header and footer into the directory. wp-content/themes/responsive/ Then, create a new page in the WordPress. Give it whatever title you would like at the top of the page and on the right side of the text-editor expand the Template dropdown box and select the list item that matches the name you put in at the top of your page. Figure 3.1: Template Select Do not put anything in the page’s text editor section. When this page is saved, the content in your original file will be displayed inside the standard WordPress header and footer. Make sure to add the page to the menu at the top of the page, as described in the Manual” section “User labeled Updating the Menu. Adding Custom User Fields When we were adding the membership functionality to the site, it occurred to us that the user profile fields that existed didn’t tell us much about the users in an E-Sports context. We thought that it would be interesting to give site members the option to add other user fields, such as their Steam username, League of Legends account name, or Twitch username so that Vespa could utilize that information. We implemented the addition of the Twitch username. The file listed above named account.form.php contains a new chunk of HTML code that allows users to see and edit the Twitch username field. The rest of the code that handles the Twitch username is in the functions.php. A section in functions.php is labeled with comments above and below it; that php code handles the backend. To add a new custom user field, one would simply duplicate the section of the code particular to the twitch name in the functions.php file, changing every instance of Name” “Twitch to the value of the new field. For example, the section of the code in functions.php would look like... function add_twitch_name_field( $user ) { ?> <h3><?php _e('Extra Profile Information', 'membership'); ?></h3> <table class="form-table"> <tr> <th> <label for="address"><?php _e('Twitch Name', 'membership'); ?> </label></th> <td>
Then, place the file you created with the above header and footer into the directory. wp-content/themes/responsive/ Then, create a new page in the WordPress. Give it whatever title you would like at the top of the page and on the right side of the text-editor expand the Template dropdown box and select the list item that matches the name you put in at the top of your page. Figure 3.1: Template Select Do not put anything in the page’s text editor section. When this page is saved, the content in your original file will be displayed inside the standard WordPress header and footer. Make sure to add the page to the menu at the top of the page, as described in the “User Manual” section labeled Updating the Menu. Adding Custom User Fields When we were adding the membership functionality to the site, it occurred to us that the user profile fields that existed didn’t tell us much about the users in an E-Sports context. We thought that it would be interesting to give site members the option to add other user fields, such as their Steam username, League of Legends account name, or Twitch username so that Vespa could utilize that information. We implemented the addition of the Twitch username. The file listed above named account.form.php contains a new chunk of HTML code that allows users to see and edit the Twitch username field. The rest of the code that handles the Twitch username is in the functions.php. A section in functions.php is labeled with comments above and below it; that php code handles the backend. To add a new custom user field, one would simply duplicate the section of the code particular to the twitch name in the functions.php file, changing every instance of “Twitch Name” to the value of the new field. For example, the section of the code in functions.php would look like... function add_twitch_name_field( $user ) { ?> <h3><?php _e('Extra Profile Information', 'membership'); ?></h3> <table class="form-table"> <tr> <th> <label for="address"><?php _e('Twitch Name', 'membership'); ?> </label></th> <td>
VespaProjectDocumentation.docx