{"id":17,"date":"2026-09-09T04:25:31","date_gmt":"2026-09-09T04:25:31","guid":{"rendered":"https:\/\/nirohelp.com\/docs\/17\/code-blocks-and-images\/"},"modified":"2026-09-23T15:37:14","modified_gmt":"2026-09-23T09:37:14","slug":"code-blocks-and-images","status":"publish","type":"nirohelp_doc","link":"https:\/\/nirohelp.com\/docs\/knowledge-base\/code-blocks-and-images\/","title":{"rendered":"Code blocks, image zoom and heading links"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">NiroHelp adds three reader-facing extras to docs: syntax highlighting for code, click-to-zoom on images, and automatic links on headings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Syntax-highlighted code blocks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Wrap code in the <code>[nirohelp_code]<\/code> shortcode and say which language it is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;nirohelp_code lang=\"php\"]\nyour code here\n&#091;\/nirohelp_code]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The language defaults to <code>php<\/code>. Any common language name works &#8211; js, ts, css, html, bash, json, yaml, sql, python, go, ruby, rust and the rest.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your code is displayed exactly as written, and line breaks the visual editor added are cleaned up first, so pasted code survives.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The block editor&#8217;s own Code block is not highlighted.<\/strong> It produces a plain code block with no language attached, so it renders unstyled. Use the shortcode when you want colours.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Image zoom<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Images inside a doc&#8217;s body are made clickable automatically: clicking one opens it full size in a lightbox, and clicking outside or pressing <kbd>Esc<\/kbd> closes it. Images you have already linked to something else are left alone, so a screenshot that links somewhere keeps its link.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is no setting for this. Turning it off needs a developer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Heading links<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On a single doc, each heading gets a small <code>#<\/code> link beside it, so readers can copy a link straight to a section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On docs written in the block editor, headings usually do not get one.<\/strong> The feature only recognises plain headings, and the block editor adds styling information to every heading it produces. Headings written in the classic editor do get their links.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you rely on links to specific sections, write those headings in the classic editor, and check the published page before you announce the link.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Featured image<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The featured image appears in the docs archive and at the top of the doc itself. NiroHelp does not set the image used when someone shares your doc on social media &#8211; that comes from whichever SEO plugin you run, reading the same featured image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A note on page weight<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The syntax-highlighting files load on <strong>every<\/strong> page of your site, not only on docs. If page weight matters to you, a developer can limit them to doc pages. The image-zoom files load on single docs only.<\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"nirohelp_product":[],"nirohelp_topic":[4],"class_list":["post-17","nirohelp_doc","type-nirohelp_doc","status-publish","hentry","nirohelp_topic-knowledge-base"],"_links":{"self":[{"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/nirohelp_doc\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/nirohelp_doc"}],"about":[{"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/types\/nirohelp_doc"}],"author":[{"embeddable":true,"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"nirohelp_product","embeddable":true,"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/nirohelp_product?post=17"},{"taxonomy":"nirohelp_topic","embeddable":true,"href":"https:\/\/nirohelp.com\/docs\/wp-json\/wp\/v2\/nirohelp_topic?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}