{"id":2285,"date":"2017-08-14T09:45:05","date_gmt":"2017-08-14T13:45:05","guid":{"rendered":"https:\/\/www.pair.com\/support\/kb\/?p=2285"},"modified":"2021-11-04T13:42:15","modified_gmt":"2021-11-04T17:42:15","slug":"formatting-code-in-wordpress-posts","status":"publish","type":"ht_kb","link":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/","title":{"rendered":"Classic Editor: Formatting Code in WordPress Posts"},"content":{"rendered":"<p class=\"p1\"><span class=\"s1\"><a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/wp-enthusiast\/\"><p class=\"\"style=\"background-color:#1a3d6e!important;color:#fff !important;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">WP Enthusiast<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/wp-professional\/\"><p style=\"background-color:#1a3d6e !important;color:#fff !important;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">WP Professional<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/wp-professional-plus\/\"><p style=\"background-color:#1a3d6e !important;color:#fff !important;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">WP Professional Plus<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/pairsim-wordpress\/\"><p style=\"background-color:#1a3d6e !important;color:#fff !important;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">PairSIM WordPress<\/p><\/a><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also <\/span><a href=\"https:\/\/www.pair.com\/support\/kb\/how-to-change-wordpress-fonts\/\"><span style=\"font-weight: 400;\">change WordPress fonts<\/span><\/a> <span style=\"font-weight: 400;\">and headings to help clarify sections.<\/span><\/p>\n<p>If you are using the Gutenberg Block Editor, see the <a href=\"https:\/\/www.pair.com\/support\/kb\/gutenberg-editor-formatting-code-in-wordpress-posts\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u00a0Block Editor: Formatting Code in WordPress Posts article<\/a>.<\/p>\n<h3>Formatting Code in WordPress Posts<\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Open a post or create a new one<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the text you would like to format as code<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click the text type box next to the plus button<a href=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2292\" src=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1.png\" alt=\"text type box location photo\" width=\"557\" height=\"288\" srcset=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1.png 557w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1-300x155.png 300w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1-60x31.png 60w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1-150x78.png 150w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select <\/span><b>Preformatted<\/b><span style=\"font-weight: 400;\"> from the drop-down<a href=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2294\" src=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1.png\" alt=\"Preformatted drop down location photo\" width=\"547\" height=\"288\" srcset=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1.png 547w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1-300x158.png 300w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1-60x32.png 60w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Preformatted-1-150x79.png 150w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/><\/a> <\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">This will change your selected text to display as a single line of \u201cPreformatted\u201d text in the editor. If you want to see what this will look like in a published post, click <\/span><b>Preview<\/b><span style=\"font-weight: 400;\">.<a href=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-2295 aligncenter\" src=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2.png\" alt=\"Preview button location photo\" width=\"557\" height=\"288\" srcset=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2.png 557w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2-300x155.png 300w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2-60x31.png 60w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type2-2-150x78.png 150w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a> <\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">This will display a preview of what the published post will look like.<a href=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-2289 aligncenter\" src=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview.png\" alt=\"preview photo showing preformatted text and regular text\" width=\"799\" height=\"331\" srcset=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview.png 799w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview-300x124.png 300w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview-768x318.png 768w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview-60x25.png 60w, https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/preview-150x62.png 150w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a> <\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. If you are using the Gutenberg Block Editor, see the \u00a0Block Editor: Formatting Code in WordPress Posts article. Formatting Code in WordPress Posts&#8230;<\/p>\n","protected":false},"author":11,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[201],"ht-kb-tag":[205,185,200],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks<\/title>\n<meta name=\"description\" content=\"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.\" \/>\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.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks\" \/>\n<meta property=\"og:description\" content=\"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - Pair Networks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pairnetworks\/\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-04T17:42:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@pairNetworks\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/\",\"name\":\"Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks\",\"isPartOf\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\"},\"datePublished\":\"2017-08-14T13:45:05+00:00\",\"dateModified\":\"2021-11-04T17:42:15+00:00\",\"description\":\"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pair.com\/support\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Classic Editor: Formatting Code in WordPress Posts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"name\":\"Knowledge Base - Pair Networks\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\",\"name\":\"Pair Networks\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"contentUrl\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"width\":360,\"height\":360,\"caption\":\"Pair Networks\"},\"image\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pairnetworks\/\",\"https:\/\/twitter.com\/pairNetworks\",\"https:\/\/www.instagram.com\/pairnetworks\/\",\"https:\/\/www.linkedin.com\/company\/2269676\/\",\"https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/\",\"https:\/\/www.youtube.com\/user\/pairnetworks\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks","description":"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.","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.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/","og_locale":"en_US","og_type":"article","og_title":"Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks","og_description":"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.","og_url":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/","og_site_name":"Knowledge Base - Pair Networks","article_publisher":"https:\/\/www.facebook.com\/pairnetworks\/","article_modified_time":"2021-11-04T17:42:15+00:00","og_image":[{"url":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2017\/08\/Text-Type-1.png"}],"twitter_card":"summary_large_image","twitter_site":"@pairNetworks","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/","url":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/","name":"Classic Editor: Formatting Code in WordPress Posts - Knowledge Base - Pair Networks","isPartOf":{"@id":"https:\/\/www.pair.com\/support\/kb\/#website"},"datePublished":"2017-08-14T13:45:05+00:00","dateModified":"2021-11-04T17:42:15+00:00","description":"Distinguishing the difference between regular text and code can be very helpful in technical articles. You can also change WordPress fonts and headings to help clarify sections. Learn how to format code in WordPress in this article.","breadcrumb":{"@id":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pair.com\/support\/kb\/formatting-code-in-wordpress-posts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pair.com\/support\/kb\/"},{"@type":"ListItem","position":2,"name":"Classic Editor: Formatting Code in WordPress Posts"}]},{"@type":"WebSite","@id":"https:\/\/www.pair.com\/support\/kb\/#website","url":"https:\/\/www.pair.com\/support\/kb\/","name":"Knowledge Base - Pair Networks","description":"","publisher":{"@id":"https:\/\/www.pair.com\/support\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pair.com\/support\/kb\/#organization","name":"Pair Networks","url":"https:\/\/www.pair.com\/support\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","contentUrl":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","width":360,"height":360,"caption":"Pair Networks"},"image":{"@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pairnetworks\/","https:\/\/twitter.com\/pairNetworks","https:\/\/www.instagram.com\/pairnetworks\/","https:\/\/www.linkedin.com\/company\/2269676\/","https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/","https:\/\/www.youtube.com\/user\/pairnetworks"]}]}},"_links":{"self":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2285"}],"collection":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/comments?post=2285"}],"version-history":[{"count":12,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2285\/revisions"}],"predecessor-version":[{"id":8148,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2285\/revisions\/8148"}],"wp:attachment":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/media?parent=2285"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=2285"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=2285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}