HTML Code

HTML tab of the WP Coder Pro editor with If and Loop tags, and the Insert, Preview and Output panel

The HTML tab is where you write the markup of your snippet. The big editor holds the HTML; the panel beside it holds helper buttons and options.

Tip: write only the body markup — no <html>, <head> or <body> wrappers. The snippet is placed inside an existing page.


The code editor#

All four code tabs (HTML, CSS, JS, PHP) and Global PHP share one editor with syntax highlighting, line numbers, bracket matching, linting and code folding. Every helper button inserts text at the cursor.

Shortcut Action
Ctrl/Cmd + S Save the snippet
Ctrl + F Find
Ctrl + H (Cmd + Alt + F on Mac) Replace
Shift + Ctrl + R Replace all
Ctrl/Cmd + D Select the next occurrence
Alt + G Go to line
Ctrl + Space Autocomplete
Ctrl + / Toggle comment
F11 Full screen (Esc leaves it)

Typing {{ offers your attributes, global variables and library icons. PRO

Live Preview#

Renders your HTML and CSS in the editor as you type, without saving.

Theme Stylesheet PRO#

Loads your active theme’s main stylesheet inside the Live Preview, so the preview shows the theme’s fonts and base styles. It affects only the preview.

QuickCode PRO#

The QuickCode button (Ctrl + E, also on a Mac) opens a searchable list of {{…}} placeholders that print WordPress data — site, user, post, menu, query, ACF, WooCommerce. It appears when Tools → Site Tools → Enable QuickCode is on. A Global Vars button inserts your {{global.name}} values. Full reference: QuickCode.

Add Image#

Opens the media library and inserts a responsive <img> with alt, width, height, srcset and sizes. It leaves loading off, so WordPress decides whether the image loads eagerly or lazily.

WP Coder (free): inserts <img> with src, alt, width, height and loading="lazy", without srcset and sizes.

Icons PRO#

Opens your icon library: search, tick Color from CSS or Full markup if you need them, and click an icon to insert {{svg.name}}. The Live Preview shows the icons.

Minified#

Minifies the HTML on the front end. It is safe for real markup: <pre>, <textarea>, <script>, <style> and attribute values are left exactly as written, and spaces between words and inline elements are kept.

Allow PHP in HTML PRO#

Runs <?php … ?> written directly in the HTML.

WP Coder (free): PHP in the HTML is not run. Set a variable in the PHP tab instead — $year = date( 'Y' ); with Run where inserted — and print it in the HTML as {{year}}. That works in both plugins.

  • Before it runs, the code is scanned. A forbidden function (eval, exec, system, shell_exec, passthru, popen, proc_open, pcntl_exec, assert, create_function, base64_decode or the backtick operator) stops it, and an HTML comment is printed instead.
  • Attribute values are available as PHP variables ($heading), and the snippet’s PHP tab runs first when it is set to Run where inserted — its variables reach the HTML.

Use it for small bits of logic. Bigger code reads better in the PHP tab.

Add NAV Comment#

Inserts <!-- NAV: --> on its own line above the cursor. The editor lists these markers as a clickable outline, so you can jump between sections of long markup. The CSS, JS and PHP tabs have the same button.

Loop Logic PRO#

The Loop Logic button (when Enable Loop Logic is on) opens a reference and inserts ready-made <If> and <Loop> blocks:

<If field="show_badge" value="1">
  <span class="badge">{{$badge}}</span>
</If>

<Loop field="features">
  <li>{{loop.text}}</li>
</Loop>

Full reference: Loop Logic.

Attributes panel PRO#

When the snippet has attributes, the panel shows a chip for each one. Click to insert the right placeholder:

  • Text, URL, Number… → {{$name}}
  • Image → {{$name_html}} (a full optimized <img>), plus chips for _url, _alt, _width, _height, _srcset, _html_high
  • Font Awesome icon → <i class="{{$name}}"></i>
  • Repeater → a <Loop> block (with Loop Logic on) or {{$name}}

Where the HTML appears#

The HTML is placed on the page in one of four ways:

  • Automatically — with Display: Everywhere (or Pro’s Display Rules), at the chosen Location.
  • Shortcode — [wp_code id="12"] in a post, page, widget or template.
  • Block — the WP Coder Snippet block in the block editor.
  • Template PRO — the snippet replaces the theme template on matching pages (Page Templates).