style.css<\/strong><\/p>\nfunction wpb_author_info_box($content) {\n\n global $post;\n\n \/\/ Detect if it is a single post with a post author\n if (is_single() && isset($post - > post_author)) {\n\n \/\/ Get author's display name \n $display_name = get_the_author_meta('display_name', $post - > post_author);\n\n \/\/ If display name is not available then use nickname as display name\n if (empty($display_name))\n $display_name = get_the_author_meta('nickname', $post - > post_author);\n\n \/\/ Get author's biographical information or description\n $user_description = get_the_author_meta('user_description', $post - > post_author);\n\n \/\/ Get author's website URL \n $user_website = get_the_author_meta('url', $post - > post_author);\n\n \/\/ Get link to the author archive page\n $user_posts = get_author_posts_url(get_the_author_meta('ID', $post - > post_author));\n\n if (!empty($display_name))\n\n $author_details = '<p class=\"author_name\">About '.$display_name.\n '<\/p>';\n\n if (!empty($user_description))\n \/\/ Author avatar and bio\n\n $author_details. = '<p class=\"author_details\">'.get_avatar(get_the_author_meta('user_email'), 90).nl2br($user_description).\n '<\/p>';\n\n $author_details. = '<p class=\"author_links\"><a href=\"'.$user_posts.'\">View all posts by '.$display_name.\n '<\/a>';\n\n \/\/ Check if author has a website in their profile\n if (!empty($user_website)) {\n\n \/\/ Display author website link\n $author_details. = ' | <a href=\"'.$user_website.\n '\" target=\"_blank\" rel=\"nofollow\">Website<\/a><\/p>';\n\n } else {\n \/\/ if there is no author website then just close the paragraph\n $author_details. = '<\/p>';\n }\n\n \/\/ Pass all this info to post content \n $content = $content.\n '<footer class=\"author_bio_section\" >'.$author_details.\n '<\/footer>';\n }\n return $content;\n}\n\n\/\/ Add our function to the post content filter \nadd_action('the_content', 'wpb_author_info_box');\n\n\/\/ Allow HTML in author bio section \nremove_filter('pre_user_description', 'wp_filter_kses');<\/pre>\n.author_bio_section{\n background: none repeat scroll 0 0 #F5F5F5;\n padding: 15px;\n border: 1px solid #ccc;\n}\n \n.author_name{\n font-size:16px;\n font-weight: bold;\n}\n \n.author_details img {\n border: 1px solid #D8D8D8;\n border-radius: 50%;\n float: left;\n margin: 0 10px 10px 0;\n}<\/pre>\nKode di atas akan memanggil informasi penulis\/author dan menampilkannya di bawah postingan.<\/p>\n
Maka nanti hasilnya akan seperti ini:<\/p>\n
<\/p>\n
<\/span>Alternatif Lain<\/span><\/h2>\nAlternatif lain adalah dengan membuat stuktur HTML untuk Author Box ini dan menambahkannya ke dalam file single post di situs Anda, kalau di saya nama file nya adalah content-single.php<\/strong>. Posisikan struktur HTML ini sesuai dengan keinginan, biasanya di bawah blok konten (isi artikel).<\/p>\n<div class=\"media author-box\">\n <div class=\"media-figure\">\n <?php echo get_avatar( get_the_author_meta('email'), '100' ); ?>\n <\/div>\n <div class=\"media-body\">\n <h2><?php the_author_posts_link(); ?><\/h2>\n <p><?php the_author_meta('description'); ?><\/p>\n <div class=\"author-icons\">\n <a href=\"<?php the_author_meta('site_url'); ?>\" class=\"author-website\">\n <img src=\"\/wp-content\/uploads\/icon-link.png\" alt=\"Website\" \/> |\n <\/a>\n <a href=\"<?php the_author_meta('twitter'); ?>\" class=\"author-twitter\">\n <img src=\"\/wp-content\/uploads\/icon-twitter.png\" alt=\"Twitter\" \/> |\n <\/a>\n <a href=\"<?php the_author_meta('facebook'); ?>\" class=\"author-facebook\">\n <img src=\"\/wp-content\/uploads\/icon-facebook.png\" alt=\"Facebook\" \/>\n <\/a>\n <\/div>\n <\/div>\n <\/div><\/pre>\n.media {\n display: flex;\n align-items: flex-start;\n}\n\n.media-figure {\n margin-right: 1em;\n}\n\n.media-figure img {\n border-radius: 50%;\n}\n\n.media-body {\n flex: 1;\n}\n\n.media-body h2 {\n margin: 0;\n}\n\n.author-box {\n background: #f7f7f7;\n padding: 20px;\n border-radius: 2px;\n}<\/pre>\nHasilnya akan seperti ini:<\/p>\n
<\/p>\n
Image credit: wpbeginner.com<\/a><\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"Author Box atau disebut juga Author Bio Box adalah kotak yang menampilkan informasi tentang penulis. Kotak ini biasanya ditampilkan di \n ...<\/a>","protected":false},"author":3,"featured_media":12830,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","two_page_speed":[]},"categories":[2092],"yoast_head":"\nCara Menambahkan Author Box di WordPress Posts | Pugam<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n