{"id":23061,"date":"2015-01-06T23:01:17","date_gmt":"2015-01-06T15:01:17","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=23061"},"modified":"2025-04-04T02:02:01","modified_gmt":"2025-04-03T18:02:01","slug":"wordpress-snippets-customize-theme","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/","title":{"rendered":"10 WordPress Snippets For Theme Customizations"},"content":{"rendered":"<p>When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/go\/elegant\">WordPress Themes<\/a> available both for free or for a premium price. Pick a theme, install it, and you can get a completely new look for your website within minutes.<\/p>\n<p>But beyond giving the look and feel, a WordPress theme can be extended in many ways as well. You can build new functionalities <a href=\"https:\/\/www.hongkiat.com\/blog\/essential-wordpress-plugins\/\">with plugins<\/a>, but in this post, we\u2019re looking at <strong>WordPress functions that can be handy for your theme<\/strong>. You just have to put these functions in the functions.php file of your theme for the effect to take place.<\/p>\n<p>Recommended Reading: <a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-manage-code-snippets\/\">How To Manage And Use Code Snippets In WordPress<\/a><\/p>\n<h2>1. Change The Length Of Excerpt<\/h2>\n<p>An <strong>excerpt<\/strong> is a short piece of your post that you can see. WordPress, in this case, sets the excerpt to be 55 words long by default. But, WordPress allows us to customize the default length through the <code>excerpt_length<\/code> filter, as follows.<\/p>\n<pre>\r\nfunction my_excerpt_length( $length ) {\r\n   return 30;\r\n}\r\nadd_filter( 'excerpt_length', 'my_excerpt_length', 999 );\r\n<\/pre>\n<p>The return value refers to the sum of words that will be displayed as an excerpt. In the example above, we display 30 words worth of each post in the excerpt.<\/p>\n<h2>2. Reduce Post Revisions<\/h2>\n<p>WordPress lets writers and bloggers look back at  previous versions of their work. However, as the revisions grow in number, they may also affect  a website\u2019s performance as each newly recorded revision adds a new row to the database. This problem will only get worse over time.<\/p>\n<p>To solve this issue, you can set how many revisions you want to save in the database. To do this, open your <strong>wp-config.php<\/strong> and add this snippet below. Change the number to limit the number of revisions you want saved.<\/p>\n<pre>\r\ndefine('WP_POST_REVISIONS', 5);\r\n<\/pre>\n<p>If you would rather disable WordPress revision, switch the value to <code>FALSE<\/code> like this:<\/p>\n<pre>\r\ndefine('WP_POST_REVISIONS', false);\r\n<\/pre>\n<h2>3. Automatically Set Featured Image On A Post<\/h2>\n<p>It\u2019s common practice to display a featured image that represents or describes a post. WordPress requires us to set this featured image <strong>manually<\/strong>. To make the process more efficient, we can set the featured image <strong>automatically<\/strong> by making the first image in the post the featured image. Use the following code snippet.<\/p>\n<pre>\r\nfunction autoset_featured() {\r\n    global $post;\r\n    $already_has_thumb = has_post_thumbnail($post->ID);\r\n    if (!$already_has_thumb)  {\r\n    $attached_image = get_children( \"post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1\" );\r\n    \tif ($attached_image) {\r\n            foreach ($attached_image as $attachment_id => $attachment) {\r\n            \tset_post_thumbnail($post->ID, $attachment_id);\r\n            }\r\n       \t}\r\n     }\r\n}\r\nadd_action('the_post', 'autoset_featured');\r\nadd_action('save_post', 'autoset_featured');\r\nadd_action('draft_to_publish', 'autoset_featured');\r\nadd_action('new_to_publish', 'autoset_featured');\r\nadd_action('pending_to_publish', 'autoset_featured');\r\nadd_action('future_to_publish', 'autoset_featured');\r\n<\/pre>\n<h2>4. Force Minimum Comment Length<\/h2>\n<p>Not a fan of the 1-2 word comments like \u201cNice Post!\u201d, \u201cGood Job!\u201d? Although the comment might not be spam, these are the type of comments that  will not typically encourage further discussions. If you want to get your commenters talking, you can set a minimum length of words required before readers can post their comment.<\/p>\n<p>Below is the snippet to set the minimum number of characters or words for comments. Put it in <strong>functions.php<\/strong>.<\/p>\n<pre>\r\nfunction minimal_comment_length( $commentdata ) {\r\n    $minimalCommentLength = 20;\r\n    if ( strlen( trim( $commentdata['comment_content'] ) ) < $minimalCommentLength ){\r\n   \t \twp_die( 'All comments must be at least ' . $minimalCommentLength . ' characters long.' );\r\n\t}\r\n\treturn $commentdata;\r\n}\r\nadd_filter( 'preprocess_comment', 'minimal_comment_length' );\r\n<\/pre>\n<p><code>$minimalCommentLength<\/code> value is the minimum number of characters that is required, make your changes to this value to tweak this.<\/p>\n<h2>5. Disable Links From User Comments<\/h2>\n<p>Links that are included in the comments form will instantly become a clickable link once they are posted and approved. This can be exploited by spammers, encouraging them to flood your comment section with a link to their \"spammy\" page.<\/p>\n<p>To counter this, you can add this filter to disable the click-ability of the link(s) and retain them simply as plain text.<\/p>\n<pre>\r\nremove_filter('comment_text', 'make_clickable', 9);\r\n<\/pre>\n<h2>6. Remove Class And ID's From Custom Menus<\/h2>\n<p>If you look at the custom menu in WordPress, you will find a bunch of classes and ids on every menu item. Use the snippet below to remove the classes you don't want and to keep the classes that you need.<\/p>\n<pre>\r\nfunction my_css_attributes_filter($var) {\r\n\treturn is_array($var) ? array_intersect($var, array('current-menu-item')) : '';\r\n}\r\nadd_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);\r\nadd_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);\r\nadd_filter('page_css_class', 'my_css_attributes_filter', 100, 1);<\/pre>\n<p>In the above code, we are keeping the <code>current-menu-item<\/code> class.<\/p>\n<h2>7. Exclude Pages From Search<\/h2>\n<p>Doing searches in WordPress will pull results from both pages and posts, sometimes with not much relevance to your search query. To prevent this, you can filter the search results to show only those found in posts.  Add this snippet to <strong>function.php<\/strong> to do this.<\/p>\n<pre>\r\nfunction SearchFilter($query) {\r\n\tif ($query->is_search) {\r\n\t\t$query->set('post_type', 'post');\r\n\t}\r\n\treturn $query;\r\n}\r\nadd_filter('pre_get_posts','SearchFilter');\r\n<\/pre>\n<h2>8. Replace Howdy Text<\/h2>\n<p>Bored with the 'Howdy' text? If you want to change that to a special salutation on your site, just add this to functions.php and the effect will take place immediately.<\/p>\n<pre>\r\nfunction change_howdy($translated, $text, $domain) {\r\n\tif (false !== strpos($translated, 'Howdy'))\r\n\treturn str_replace('Howdy', 'Hello', $translated);\r\n\treturn $translated;\r\n}\r\nadd_filter('gettext', 'change_howdy', 10, 3);\r\n<\/pre>\n<h2>9. Add Additional Menu Removal For Particular Roles<\/h2>\n<p>You can hide menus that are in the Dashboard, for non-administrators, with this snippet.<\/p>\n<pre>\r\nfunction remove_admin_menus(){\r\n\tif(is_user_logged_in() && !current_user_can('administrator')){\r\n\t\tremove_menu_page( 'index.php' );                  \/\/Dashboard\r\n\t\tremove_menu_page( 'edit.php' );                   \/\/Posts\r\n\t\tremove_menu_page( 'upload.php' );                 \/\/Media\r\n\t\tremove_menu_page( 'edit.php?post_type=page' );    \/\/Pages\r\n\t\tremove_menu_page( 'edit-comments.php' );          \/\/Comments\r\n\t\tremove_menu_page( 'themes.php' );                 \/\/Appearance\r\n\t\tremove_menu_page( 'plugins.php' );                \/\/Plugins\r\n\t\tremove_menu_page( 'users.php' );                  \/\/Users\r\n\t\tremove_menu_page( 'tools.php' );                  \/\/Tools\r\n\t\tremove_menu_page( 'options-general.php' );        \/\/Settings\r\n\t}\r\n}\r\nadd_action('admin_init', 'remove_admin_menus');\r\n<\/pre>\n<p>Please note that this just removes the menus from the screen, but does not filter the user's permission to access these menu. It does not prevent a user from accessing those menus directly through the browser address bar. Remember to add them to your <strong>functions.php<\/strong>.<\/p>\n<h2>10. Remove Admin Bar Link For Non-Adminstrators<\/h2>\n<p>In the WordPress Dashboard, besides the main menu on the sidebar, you will also find a couple of menu links at the top. You can restrict access to this admin bar link from specific roles or users. This snippet below will remove the menu in the admin bar for users who aren't an Administrator \u2013 adjust accordingly.<\/p>\n<pre>\r\nfunction remove_admin_bar_links() {\r\n\tglobal $wp_admin_bar;\r\n\tif (!current_user_can('administrator')) {\r\n\t\t$wp_admin_bar->remove_menu('wp-logo');          \/\/ Remove the WordPress logo\r\n\t\t$wp_admin_bar->remove_menu('about');            \/\/ Remove the about WordPress link\r\n\t\t$wp_admin_bar->remove_menu('wporg');            \/\/ Remove the WordPress.org link\r\n\t\t$wp_admin_bar->remove_menu('documentation');    \/\/ Remove the WordPress documentation link\r\n\t\t$wp_admin_bar->remove_menu('support-forums');   \/\/ Remove the support forums link\r\n\t\t$wp_admin_bar->remove_menu('feedback');         \/\/ Remove the feedback link\r\n\t\t$wp_admin_bar->remove_menu('site-name');        \/\/ Remove the site name link\r\n\t\t$wp_admin_bar->remove_menu('view-site');        \/\/ Remove the visit site link\r\n\t\t$wp_admin_bar->remove_menu('updates');          \/\/ Remove the updates link\r\n\t\t$wp_admin_bar->remove_menu('comments');         \/\/ Remove the comments link\r\n\t\t$wp_admin_bar->remove_menu('new-content');      \/\/ Remove the new content link\r\n\t\t$wp_admin_bar->remove_menu('my-account');       \/\/ Remove the user details tab\r\n\t}\r\n}\r\nadd_action('wp_before_admin_bar_render', 'remove_admin_bar_links');\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress Themes available both for free or for a premium price. Pick a theme, install it, and you can get a completely new look for your website within&hellip;<\/p>\n","protected":false},"author":141,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,3428,365],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>10 WordPress Snippets For Theme Customizations - Hongkiat<\/title>\n<meta name=\"description\" content=\"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 WordPress Snippets For Theme Customizations\" \/>\n<meta property=\"og:description\" content=\"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-06T15:01:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T18:02:01+00:00\" \/>\n<meta name=\"author\" content=\"Agus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bagusdesain\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Agus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/\"},\"author\":{\"name\":\"Agus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\"},\"headline\":\"10 WordPress Snippets For Theme Customizations\",\"datePublished\":\"2015-01-06T15:01:17+00:00\",\"dateModified\":\"2025-04-03T18:02:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/\"},\"wordCount\":810,\"commentCount\":15,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"ad-divi\",\"wordpress snippets\",\"WordPress Themes\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/\",\"name\":\"10 WordPress Snippets For Theme Customizations - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2015-01-06T15:01:17+00:00\",\"dateModified\":\"2025-04-03T18:02:01+00:00\",\"description\":\"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-snippets-customize-theme\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"10 WordPress Snippets For Theme Customizations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\",\"name\":\"Agus\",\"description\":\"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/bagusdesain\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/agus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"10 WordPress Snippets For Theme Customizations - Hongkiat","description":"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/","og_locale":"en_US","og_type":"article","og_title":"10 WordPress Snippets For Theme Customizations","og_description":"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress","og_url":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2015-01-06T15:01:17+00:00","article_modified_time":"2025-04-03T18:02:01+00:00","author":"Agus","twitter_card":"summary_large_image","twitter_creator":"@bagusdesain","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Agus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/"},"author":{"name":"Agus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd"},"headline":"10 WordPress Snippets For Theme Customizations","datePublished":"2015-01-06T15:01:17+00:00","dateModified":"2025-04-03T18:02:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/"},"wordCount":810,"commentCount":15,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["ad-divi","wordpress snippets","WordPress Themes"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/","url":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/","name":"10 WordPress Snippets For Theme Customizations - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2015-01-06T15:01:17+00:00","dateModified":"2025-04-03T18:02:01+00:00","description":"When you are using WordPress, it is extremely easy to change the look of your website, thanks to themes. There are lots (like a whole bunch) of WordPress","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-snippets-customize-theme\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"10 WordPress Snippets For Theme Customizations"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd","name":"Agus","description":"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.","sameAs":["https:\/\/x.com\/bagusdesain"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/agus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-5ZX","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=23061"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23061\/revisions"}],"predecessor-version":[{"id":73722,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23061\/revisions\/73722"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=23061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=23061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=23061"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=23061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}