
{"id":5006,"date":"2016-01-23T04:02:36","date_gmt":"2016-01-23T04:02:36","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=5006"},"modified":"2016-03-29T04:04:31","modified_gmt":"2016-03-29T04:04:31","slug":"tao-trang-profile-cho-thanh-vien-khong-can-plugin","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/tao-trang-profile-cho-thanh-vien-khong-can-plugin\/","title":{"rendered":"T\u1ea1o trang profile cho th\u00e0nh vi\u00ean kh\u00f4ng c\u1ea7n plugin"},"content":{"rendered":"<p>N\u1ebfu website c\u1ee7a b\u1ea1n cho ph\u00e9p \u0111\u0103ng k\u00fd th\u00e0nh vi\u00ean th\u00ec ch\u1eafc h\u1eb5n b\u1ea1n s\u1ebd mu\u1ed1n t\u1ea1o m\u1ed9t trang profile cho m\u1ed7i th\u00e0nh vi\u00ean \u1edf ngo\u00e0i front-end.<!--more--><\/p>\n<p>M\u1eb7c \u0111\u1ecbnh WordPress ch\u01b0a cung c\u1ea5p s\u1eb5n ch\u1ee9c n\u0103ng n\u00e0y nh\u01b0ng n\u1ebfu mu\u1ed1n b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c plugins \u0111\u1ec3 h\u1ed7 tr\u1ee3. Tuy nhi\u00ean m\u00ecnh \u0111\u00e3 th\u1eed qua kh\u00e1 nhi\u1ec1u plugin v\u1eabn kh\u00f4ng th\u1ea5y v\u1eeba \u00fd v\u1edbi nhi\u1ec1u l\u00fd do nh\u01b0 c\u00e1ch tr\u00ecnh b\u00e0y, ng\u00f4n ng\u1eef, kh\u00f4ng cho b\u1ed5 sung th\u00f4ng tin&#8230;<\/p>\n<p>Trong b\u00e0i vi\u1ebft n\u00e0y, m\u00ecnh s\u1ebd gi\u1edbi thi\u1ec7u m\u1ed9t th\u1ee7 thu\u1eadt \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o trang profile cho th\u00e0nh vi\u00ean m\u00e0 kh\u00f4ng c\u1ea7n d\u00f9ng t\u1edbi plugins. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 b\u1ed5 sung th\u00eam c\u00e1c tr\u01b0\u1eddng th\u00f4ng tin c\u1ea7n thi\u1ebft v\u00e0 t\u1ea1o trang ch\u1ec9nh s\u1eeda th\u00f4ng tin c\u00e1 nh\u00e2n c\u1ee7a th\u00e0nh vi\u00ean.<\/p>\n<p>B\u1ed5 sung th\u00eam th\u00f4ng tin th\u00e0nh vi\u00ean<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/luuduchieu.com\/upload\/repository\/2016\/tintuc\/03\/tao-trang-profile-cho-thanh-vien-khong-can-plugin\/bo-xung-thong-tin-thanh-vien.png\" class=\"aligncenter\" \/><\/p>\n<p>B\u1ea1n s\u1eed d\u1ee5ng code d\u01b0\u1edbi \u0111\u00e2y ch\u00e8n v\u00e0o file functions.php \u0111\u1ec3 b\u1ed5 sung th\u00eam c\u00e1c tr\u01b0\u1eddng th\u00f4ng tin m\u00e0 b\u1ea1n mu\u1ed1n th\u00e0nh vi\u00ean cung c\u1ea5p:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction add_contact_methods($profile_fields) {\r\n   $profile_fields&#x5B;'ns'] = 'N\u0103m sinh';\r\n   $profile_fields&#x5B;'sdt'] = 'S\u1ed1 \u0111i\u1ec7n tho\u1ea1i';\r\n   $profile_fields&#x5B;'dc'] = '\u0110\u1ecba ch\u1ec9';\r\n   $profile_fields&#x5B;'nn'] = 'Ngh\u1ec1 nghi\u1ec7p';\r\n   return $profile_fields;\r\n}\r\nadd_filter('user_contactmethods', 'add_contact_methods');\r\n<\/pre>\n<p>T\u1ea1o trang profile cho th\u00e0nh vi\u00ean<\/p>\n<p>Sau khi \u0111\u00e3 b\u1ed5 sung th\u00eam c\u00e1c th\u00f4ng tin c\u1ea7n thi\u1ebft, gi\u1edd ta s\u1ebd t\u1ea1o m\u1ed9t trang \u0111\u1ec3 \u0111\u01b0a c\u00e1c th\u00f4ng tin \u0111\u00f3 ra ngo\u00e0i. Tr\u01b0\u1edbc ti\u00ean, s\u1eed d\u1ee5ng \u0111o\u1ea1n code sau ch\u00e8n v\u00e0o file <strong>functions.php<\/strong> \u0111\u1ec3 t\u1ea1o m\u1ed9t shortcode hi\u1ec3n th\u1ecb th\u00f4ng tin th\u00e0nh vi\u00ean:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\nfunction profile(){ \r\nif ( !is_user_logged_in() ) { ?&gt;\r\n         &lt;p class=&quot;warning&quot;&gt;\r\n            &lt;?php echo 'B\u1ea1n ph\u1ea3i \u0111\u0103ng nh\u1eadp m\u1edbi c\u00f3 th\u1ec3 xem th\u00f4ng tin.'; ?&gt;\r\n         &lt;\/p&gt;\r\n            &lt;?php } else {\r\n                $user_ID = get_current_user_id(); \r\n                $user_info = get_userdata($user_ID);\r\n                    $username = $user_info-&gt;user_login;\r\n                    $hoten = $user_info-&gt;last_name;\r\n                    $ns = $user_info-&gt;ns;\r\n                    $email = $user_info-&gt;user_email;\r\n                    $sdt = $user_info-&gt;sdt;\r\n                    $nn = $user_info-&gt;nn;\r\n                    $dc = $user_info-&gt;dc;\r\n                    $role = implode(', ', $user_info-&gt;roles);\r\n                    $gioithieu = $user_info-&gt;description;\r\n            ?&gt;\r\n          &lt;p class=&quot;tendangnhap&quot;&gt;&lt;?php echo $username; ?&gt;&lt;\/p&gt;\r\n          &lt;p class=&quot;tendangnhap&quot;&gt;&lt;?php echo &quot;Role: $role&quot;; ?&gt;&lt;\/p&gt;\r\n        &lt;table width=&quot;100%&quot; border=&quot;0&quot;&gt;\r\n          &lt;tr&gt;\r\n                &lt;td width=&quot;50%&quot;&gt;&lt;p class=&quot;userinfo hovaten&quot;&gt;H\u1ecd v\u00e0 t\u00ean&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td width=&quot;50%&quot;&gt;&lt;p class=&quot;userinfo namsinh&quot;&gt;N\u0103m sinh&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;tr&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $hoten; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $ns; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;tr&gt;\r\n                &lt;td&gt;&lt;p class=&quot;userinfo e-mail&quot;&gt;Email&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td&gt;&lt;p class=&quot;userinfo dienthoai&quot;&gt;S\u1ed1 \u0111i\u1ec7n tho\u1ea1i&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;tr&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $email; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $sdt; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;tr&gt;\r\n                &lt;td&gt;&lt;p class=&quot;userinfo nghe&quot;&gt;Ngh\u1ec1 nghi\u1ec7p&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td&gt;&lt;p class=&quot;userinfo diachi&quot;&gt;\u0110\u1ecba ch\u1ec9&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;tr&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $nn; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n                &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;?php echo $dc; ?&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n        &lt;\/table&gt;\r\n             &lt;p class=&quot;userinfo gioithieu&quot;&gt;Gi\u1edbi thi\u1ec7u&lt;\/p&gt;\r\n             &lt;p class=&quot;info&quot;&gt;&lt;?php echo $gioithieu; ?&gt;&lt;\/p&gt;\r\n             &lt;p class=&quot;profile-submit&quot;&gt;&lt;a href=&quot;http:\/\/tenmien.com\/edit-profile\/&quot;&gt;Ch\u1ec9nh s\u1eeda th\u00f4ng tin c\u00e1 nh\u00e2n&lt;\/a&gt;&lt;\/p&gt;\r\n&lt;?php }}\r\nadd_shortcode( 'profile', 'profile' );\r\n\r\n<\/pre>\n<p>\u0110\u1ecba ch\u1ec9 http:\/\/tenmien.com\/edit-profile\/ trong \u0111o\u1ea1n code tr\u00ean l\u00e0 \u0111\u1ecba ch\u1ec9 trang ch\u1ec9nh s\u1eeda profile m\u00e0 b\u1ea1n s\u1ebd t\u1ea1o \u1edf b\u01b0\u1edbc d\u01b0\u1edbi. B\u00e2y gi\u1edd ch\u1ec9 c\u1ea7n v\u00e0o <strong>Pages \u00bb Add New<\/strong>, t\u1ea1o m\u1ed9t trang m\u1edbi v\u00e0 th\u00eam shortcode [profile] v\u00e0o n\u1ed9i dung l\u00e0 \u0111\u01b0\u1ee3c. Tuy nhi\u00ean ta c\u1ea7n b\u1ed5 sung m\u1ed9t s\u1ed1 l\u1edbp css \u0111\u1ec3 hi\u1ec3n th\u1ecb \u0111\u1eb9p h\u01a1n.<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n\/*user profile*\/\r\n.userinfo {\r\n    border-bottom: 1px solid #CCC;\r\n    padding: 0px !important;\r\n    margin-left: 10px;\r\n    font-weight:bold;\r\n}\r\n.info {\r\n    padding: 5px 0px 10px 20px !important;\r\n    background:#FFF;\r\n}\r\n.info input, .info select{\r\n    background:#FFF;\r\n    width: 210px;\r\n    padding: 5px;\r\n}\r\n.info textarea {\r\n    background:#FFF;\r\n    padding: 5px;\r\n    color: #333 !important;\r\n    font-style:normal !important;\r\n}\r\n.profile-submit {\r\n    text-align:center;\r\n    margin-top: 20px;\r\n}\r\n.profile-submit input {\r\n    color: #099;\r\n}\r\n.profile-submit a{\r\n    border:1px solid #ccc;\r\n    padding: 7px;\r\n    color: #099;\r\n    text-decoration:none;\r\n    font-weight: bold;\r\n}\r\n.profile-submit a:hover {\r\n    color: #FFF;\r\n    background: #099;\r\n}\r\n.hovaten {\r\n    background:url(images\/hoten.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.namsinh {\r\n    background:url(images\/namsinh.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.e-mail {\r\n    background:url(images\/email.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.dienthoai {\r\n    background:url(images\/dienthoai.png) left no-repeat;\r\n    padding-left: 24px !important;\r\n}\r\n.nghe {\r\n    background:url(images\/nghe.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.diachi {\r\n    background:url(images\/diachi.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.gioithieu {\r\n    background:url(images\/gioithieu.png) left no-repeat;\r\n    padding-left: 28px !important;\r\n}\r\n.matkhau {\r\n    background:url(images\/matkhau.png) left no-repeat;\r\n    padding-left: 24px !important;\r\n}\r\n.ava, .tendangnhap {\r\n    text-align: center;\r\n}\r\n.tendangnhap {\r\n    font-size: 24px;\r\n    font-weight: bold;\r\n}\r\n<\/pre>\n<p>K\u1ebft qu\u1ea3 ta s\u1ebd \u0111\u01b0\u1ee3c nh\u01b0 th\u1ebf n\u00e0y:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/luuduchieu.com\/upload\/repository\/2016\/tintuc\/03\/tao-trang-profile-cho-thanh-vien-khong-can-plugin\/hien-thi-profile-thanh-vien.png\" class=\"aligncenter\" \/><\/p>\n<p>Ti\u1ebfp theo ta s\u1ebd t\u1ea1o m\u1ed9t trang cho ph\u00e9p th\u00e0nh vi\u00ean ch\u1ec9nh s\u1eeda th\u00f4ng tin. Th\u00eam \u0111o\u1ea1n code d\u01b0\u1edbi \u0111\u00e2y v\u00e0o file functions.php:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\nfunction profile_edit(){\r\nglobal $current_user, $wp_roles;\r\nget_currentuserinfo();\r\nrequire_once( ABSPATH . WPINC . '\/registration.php' );\r\n$error = array();\r\nif ( 'POST' == $_SERVER&#x5B;'REQUEST_METHOD'] &amp;&amp; !empty( $_POST&#x5B;'action'] ) &amp;&amp; $_POST&#x5B;'action'] == 'update-user' ) {\r\n  \r\n    if ( !empty($_POST&#x5B;'pass1'] ) &amp;&amp; !empty( $_POST&#x5B;'pass2'] ) ) {\r\n        if ( $_POST&#x5B;'pass1'] == $_POST&#x5B;'pass2'] )\r\n            wp_update_user( array( 'ID' =&gt; $current_user-&gt;ID, 'user_pass' =&gt; esc_attr( $_POST&#x5B;'pass1'] ) ) );\r\n        else\r\n            $error&#x5B;] = __('M\u1eadt kh\u1ea9u kh\u00f4ng kh\u1edbp nhau.', 'profile');\r\n    }\r\n    if ( !empty( $_POST&#x5B;'url'] ) )\r\n        update_user_meta( $current_user-&gt;ID, 'user_url', esc_url( $_POST&#x5B;'url'] ) );\r\n    if ( !empty( $_POST&#x5B;'email'] ) ){\r\n        if (!is_email(esc_attr( $_POST&#x5B;'email'] )))\r\n            $error&#x5B;] = __('\u0110\u1ecba ch\u1ec9 email kh\u00f4ng kh\u1ea3 d\u1ee5ng.  Vui l\u00f2ng th\u1eed l\u1ea1i.', 'profile');\r\n        elseif(email_exists(esc_attr( $_POST&#x5B;'email'] )) != $current_user-&gt;id )\r\n            $error&#x5B;] = __('Email n\u00e0y \u0111\u00e3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng cho m\u1ed9t t\u00e0i kho\u1ea3n kh\u00e1c.  Vui l\u00f2ng th\u1eed l\u1ea1i.', 'profile');\r\n        else{\r\n            wp_update_user( array ('ID' =&gt; $current_user-&gt;ID, 'user_email' =&gt; esc_attr( $_POST&#x5B;'email'] )));\r\n        }\r\n    }\r\n    if ( !empty( $_POST&#x5B;'last-name'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'last_name', esc_attr( $_POST&#x5B;'last-name'] ) );\r\n    if ( !empty( $_POST&#x5B;'user_email'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'user_email', esc_attr( $_POST&#x5B;'user_email'] ) );\r\n    if ( !empty( $_POST&#x5B;'ns'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'ns', esc_attr( $_POST&#x5B;'ns'] ) );\r\n    if ( !empty( $_POST&#x5B;'sdt'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'sdt', esc_attr( $_POST&#x5B;'sdt'] ) );\r\n    if ( !empty( $_POST&#x5B;'dc'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'dc', esc_attr( $_POST&#x5B;'dc'] ) );\r\n    if ( !empty( $_POST&#x5B;'nn'] ) )\r\n        update_user_meta($current_user-&gt;ID, 'job', esc_attr( $_POST&#x5B;'nn'] ) );\r\n    if ( !empty( $_POST&#x5B;'description'] ) )\r\n        update_user_meta( $current_user-&gt;ID, 'description', esc_attr( $_POST&#x5B;'description'] ) );\r\n    if ( count($error) == 0 ) {\r\n        do_action('edit_user_profile_update', $current_user-&gt;ID);\r\n        wp_redirect('http:\/\/tenmien.com\/profile\/');\r\n        exit;\r\n    }\r\n}\r\n    if ( !is_user_logged_in() ) : ?&gt;\r\n                    &lt;p class=&quot;warning&quot;&gt;\r\n                        &lt;?php _e('B\u1ea1n ph\u1ea3i \u0111\u0103ng nh\u1eadp m\u1edbi c\u00f3 th\u1ec3 xem trang n\u00e0y.', 'profile'); ?&gt;\r\n                    &lt;\/p&gt;&lt;!-- .warning --&gt;\r\n            &lt;?php else : \r\n                if ( count($error) &gt; 0 ) echo '&lt;p class=&quot;error&quot;&gt;' . implode(&quot;&lt;br \/&gt;&quot;, $error) . '&lt;\/p&gt;'; ?&gt;\r\n            &lt;?php\r\n                $myAv = new simple_local_avatars();\r\n                $myAv-&gt;edit_user_profile($profileuser);\r\n            ?&gt;\r\n                &lt;form method=&quot;post&quot; id=&quot;adduser&quot; action=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;\r\n                    &lt;table width=&quot;100%&quot; border=&quot;0&quot;&gt;\r\n  &lt;tr&gt;\r\n    &lt;td width=&quot;50%&quot;&gt;&lt;p class=&quot;userinfo hovaten&quot;&gt;&lt;label for=&quot;last-name&quot;&gt;&lt;?php _e('H\u1ecd v\u00e0 t\u00ean', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td width=&quot;50%&quot;&gt;&lt;p class=&quot;userinfo namsinh&quot;&gt;&lt;label for=&quot;ns&quot;&gt;&lt;?php _e('N\u0103m sinh', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;last-name&quot; type=&quot;text&quot; id=&quot;last-name&quot; value=&quot;&lt;?php the_author_meta( 'last_name', $current_user-&gt;ID ); ?&gt;&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;ns&quot; type=&quot;date&quot; id=&quot;ns&quot; value=&quot;&lt;?php the_author_meta( 'ns', $current_user-&gt;ID ); ?&gt;&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo e-mail&quot;&gt;&lt;label for=&quot;dc&quot;&gt;&lt;?php _e('Email', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo dienthoai&quot;&gt;&lt;label for=&quot;sdt&quot;&gt;&lt;?php _e('S\u1ed1 \u0111i\u1ec7n tho\u1ea1i', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;email&quot; type=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php the_author_meta( 'user_email', $current_user-&gt;ID ); ?&gt;&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;sdt&quot; type=&quot;number&quot; id=&quot;sdt&quot; value=&quot;&lt;?php the_author_meta( 'sdt', $current_user-&gt;ID ); ?&gt;&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo nghe&quot;&gt;&lt;label for=&quot;nn&quot;&gt;&lt;?php _e('Ngh\u1ec1 nghi\u1ec7p', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo diachi&quot;&gt;&lt;label for=&quot;dc&quot;&gt;&lt;?php _e('\u0110\u1ecba ch\u1ec9', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;select size=&quot;1&quot; name=&quot;nn&quot; value=&quot;&lt;?php the_author_meta( 'nn', $current_user-&gt;ID ); ?&gt;&quot;&gt;\r\n                                &lt;option value=&quot;&quot;&gt;L\u1ef1a ch\u1ecdn....&lt;\/option&gt;\r\n                                &lt;option value=&quot;Gi\u00e1o vi\u00ean&quot;&gt;Gi\u00e1o vi\u00ean&lt;\/option&gt;\r\n                                &lt;option value=&quot;H\u1ecdc sinh&quot;&gt;H\u1ecdc sinh&lt;\/option&gt;\r\n                                &lt;option value=&quot;Sinh vi\u00ean&quot;&gt;Sinh vi\u00ean&lt;\/option&gt;\r\n                                &lt;option value=&quot;Ngh\u1ec1 kh\u00e1c&quot;&gt;Ngh\u1ec1 kh\u00e1c&lt;\/option&gt;\r\n                        &lt;\/select&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;dc&quot; type=&quot;text&quot; id=&quot;dc&quot; value=&quot;&lt;?php the_author_meta( 'dc', $current_user-&gt;ID ); ?&gt;&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo matkhau&quot;&gt;&lt;label for=&quot;pass1&quot;&gt;&lt;?php _e('M\u1eadt kh\u1ea9u m\u1edbi', 'profile'); ?&gt; &lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;userinfo matkhau&quot;&gt;&lt;label for=&quot;pass2&quot;&gt;&lt;?php _e('L\u1eadp l\u1ea1i m\u1eadt kh\u1ea9u', 'profile'); ?&gt;&lt;\/label&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;pass1&quot; type=&quot;password&quot; id=&quot;pass1&quot; \/&gt;\r\n                    &lt;\/p&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;p class=&quot;info&quot;&gt;&lt;input class=&quot;text-input&quot; name=&quot;pass2&quot; type=&quot;password&quot; id=&quot;pass2&quot; \/&gt;&lt;\/p&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n     &lt;p class=&quot;userinfo gioithieu&quot;&gt;&lt;label for=&quot;description&quot;&gt;&lt;?php _e('Gi\u1edbi thi\u1ec7u b\u1ea3n th\u00e2n', 'profile') ?&gt;&lt;\/label&gt;&lt;\/p&gt;\r\n      &lt;p class=&quot;info&quot;&gt;&lt;textarea name=&quot;description&quot; id=&quot;description&quot; rows=&quot;3&quot; cols=&quot;75&quot;&gt;&lt;?php the_author_meta( 'description', $current_user-&gt;ID ); ?&gt;&lt;\/textarea&gt;&lt;\/p&gt;\r\n      &lt;p class=&quot;profile-submit&quot;&gt;\r\n                        &lt;?php echo $referer; ?&gt;\r\n                        &lt;input name=&quot;updateuser&quot; type=&quot;submit&quot; id=&quot;updateuser&quot; class=&quot;submit button&quot; value=&quot;&lt;?php _e('C\u1eadp nh\u1eadt', 'profile'); ?&gt;&quot; \/&gt;\r\n                        &lt;?php wp_nonce_field( 'update-user' ) ?&gt;\r\n                        &lt;input name=&quot;action&quot; type=&quot;hidden&quot; id=&quot;action&quot; value=&quot;update-user&quot; \/&gt;\r\n                    &lt;\/p&gt;\r\n                &lt;\/form&gt;&lt;!-- #adduser --&gt;\r\n            &lt;?php endif; \r\n}\r\nadd_shortcode( 'edit-profile', 'profile_edit' );\r\n\r\n<\/pre>\n<p>B\u1ea1n nh\u1edb thay \u0111\u1ed5i d\u00f2ng http:\/\/tenmien.com\/profile\/ trong \u0111o\u1ea1n code tr\u00ean th\u00e0nh \u0111\u1ecba ch\u1ec9 trang profile b\u1ea1n \u0111\u00e3 t\u1ea1o \u1edf tr\u00ean. Gi\u1edd b\u1ea1n t\u1ea1o m\u1ed9t trang m\u1edbi v\u00e0 th\u00eam shortcode [edit-profile] v\u00e0o n\u1ed9i dung. K\u1ebft qu\u1ea3 b\u1ea1n s\u1ebd \u0111\u01b0\u1ee3c nh\u01b0 th\u1ebf n\u00e0y:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/luuduchieu.com\/upload\/repository\/2016\/tintuc\/03\/tao-trang-profile-cho-thanh-vien-khong-can-plugin\/tao-trang-profile-thanh-vien.png\" class=\"aligncenter\" \/><\/p>\n<p>C\u0169ng kh\u00e1 \u0111\u1eb9p m\u1eaft ph\u1ea3i kh\u00f4ng :D. Hy v\u1ecdng b\u00e0i vi\u1ebft n\u00e0y s\u1ebd gi\u00fap b\u1ea1n t\u1ea1o \u0111\u01b0\u1ee3c m\u1ed9t trang profile cho th\u00e0nh vi\u00ean v\u1ee9a \u00fd. Tuy nhi\u00ean v\u00ec th\u1ee7 thu\u1eadt n\u00e0y s\u1eed d\u1ee5ng kh\u00e1 nhi\u1ec1u \u0111o\u1ea1n code n\u00ean b\u1ea1n ph\u1ea3i bi\u1ebft ch\u00fat \u00edt v\u1ec1 code \u0111\u1ec3 c\u00f3 th\u1ec3 ch\u1ec9nh s\u1eeda l\u1ea1i cho ph\u00f9 h\u1ee3p v\u1edbi website c\u1ee7a b\u1ea1n. Ch\u00fac b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n<p>Ngu\u1ed3n: raynoblog<\/p>\n","protected":false},"excerpt":{"rendered":"<p>N\u1ebfu website c\u1ee7a b\u1ea1n cho ph\u00e9p \u0111\u0103ng k\u00fd th\u00e0nh vi\u00ean th\u00ec ch\u1eafc h\u1eb5n b\u1ea1n s\u1ebd mu\u1ed1n t\u1ea1o m\u1ed9t trang profile [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-5006","post","type-post","status-publish","format-standard","hentry","category-thu-thuat-wordpress"],"views":509,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=5006"}],"version-history":[{"count":0,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5006\/revisions"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=5006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=5006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=5006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}