Code snippets.

Tested patterns from real builds covering WordPress, ACF, WooCommerce, Shopify Liquid and performance. Each one explains when to use it, not just the code.

WordPress

WordPress register nav menu PHP – Custom Navigation

Register a nav menu location in functions.php, then render it in any template with wp_nav_menu().

May 2026
ACF

ACF Select Field — Use Choices as CSS Modifiers in PHP

Read a Select field value and apply it as a CSS modifier class on an HTML element.

May 2026
ACF

ACF Relationship Field — Loop Related Posts in PHP

Loop through hand-picked posts stored in an ACF Relationship field.

May 2026
ACF

ACF Gallery Field with Lightbox

Loop through an ACF Gallery field, render thumbnails with srcset, and open full-size images in a vanilla JS lightbox —…

May 2026
WordPress

WordPress Custom Taxonomy Registration

Register a custom taxonomy in WordPress using register_taxonomy() — hierarchical (category-like) or flat (tag-like), with full i18n labels, REST API…

May 2026
ACF

ACF Repeater Field PHP — Loop Any List of Sub-Fields

An ACF repeater field PHP loop that renders each row's sub-fields — team members, FAQs, testimonials, pricing tiers, or any…

May 2026
WordPress

Project Category Archive Navigation with 4 Column Grid

Build a filterable project grid with real category archive pages and a 4-column layout — no JavaScript, no plugin needed.

May 2026
ACF

ACF Post Grid — Dynamic Source with Grid or Carousel Layout

An ACF Flexible Content post-grid layout with two data sources — latest posts via WP_Query or hand-picked posts via a…

May 2026
WordPress

WordPress Archive Query — pre_get_posts Control PHP

This WordPress archive query PHP snippet uses pre_get_posts to control posts per page for specific archives while avoiding admin and…

May 2026