{"id":12,"date":"2026-03-17T17:49:09","date_gmt":"2026-03-17T17:49:09","guid":{"rendered":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/2026\/03\/17\/child-theme\/"},"modified":"2026-03-17T17:49:09","modified_gmt":"2026-03-17T17:49:09","slug":"child-theme","status":"publish","type":"post","link":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/2026\/03\/17\/child-theme\/","title":{"rendered":"Child Themes"},"content":{"rendered":"<p>A child theme is a small WordPress theme that depends on Legal as its parent. It inherits everything Legal does \u2014 templates, styles, functions, customizer settings \u2014 and lets you selectively override anything you need without touching Legal&#8217;s own files.<\/p>\n<p>This is the right approach when:<\/p>\n<ul>\n<li>You&#8217;re customizing Legal for a specific firm and the changes go beyond CSS (different number of practice tiles, different hero layout, custom post types, custom fields)<\/li>\n<li>You&#8217;re rebranding wholesale (different fonts, different palette, different copy patterns) and your override CSS is creeping past 100 lines<\/li>\n<li>You want your customizations to survive Legal updates indefinitely with zero risk<\/li>\n<\/ul>\n<p>If you&#8217;re just changing a color or two, use Customizer \u2192 Additional CSS instead. See <a href=\"\/custom-css\/\">Adding Custom CSS<\/a>.<\/p>\n<h2>Creating a child theme \u2014 minimum viable<\/h2>\n<p>A working child theme needs exactly two files. Create a folder under <code>wp-content\/themes\/<\/code>; let&#8217;s call it <code>legal-mychambers\/<\/code>.<\/p>\n<h3>1. style.css<\/h3>\n<pre><code>\/*\nTheme Name:   Legal \u2014 My Chambers\nTheme URI:    https:\/\/example.com\nDescription:  Custom child theme of Legal for our chambers.\nAuthor:       Your Firm\nVersion:      1.0.0\nTemplate:     legal\nText Domain:  legal-mychambers\n*\/\n\n\/* Your overrides start here. *\/<\/code><\/pre>\n<p>The two non-negotiable headers are <strong>Theme Name<\/strong> and <strong>Template<\/strong>. The <code>Template<\/code> value must exactly match the parent theme&#8217;s folder name \u2014 <code>legal<\/code>.<\/p>\n<h3>2. functions.php<\/h3>\n<pre><code>&lt;?php\n\/**\n * Legal \u2014 My Chambers child theme.\n *\/\n\ndefined( 'ABSPATH' ) || exit;\n\n\/**\n * Enqueue the parent theme's stylesheet, then ours.\n *\/\nadd_action( 'wp_enqueue_scripts', 'legal_mychambers_enqueue', 20 );\nfunction legal_mychambers_enqueue() {\n    wp_enqueue_style(\n        'legal-parent-style',\n        get_template_directory_uri() . '\/style.css',\n        array(),\n        wp_get_theme( 'legal' )-&gt;get( 'Version' )\n    );\n    wp_enqueue_style(\n        'legal-mychambers-style',\n        get_stylesheet_uri(),\n        array( 'legal-parent-style' ),\n        wp_get_theme()-&gt;get( 'Version' )\n    );\n}<\/code><\/pre>\n<p>That&#8217;s the minimum. Activate it under <strong>Appearance \u2192 Themes<\/strong>, and your site is now running the child theme. Visually nothing has changed yet \u2014 but you can now start adding overrides.<\/p>\n<h2>Overriding a template<\/h2>\n<p>To override one of Legal&#8217;s templates, copy it from <code>wp-content\/themes\/legal\/<\/code> into your child theme folder, keeping the same filename. WordPress will use your version instead of the parent&#8217;s.<\/p>\n<p>Common templates to override:<\/p>\n<ul>\n<li><strong>template-firm.php<\/strong> \u2014 the Firm Home page template. Copy this if you want to add or remove sections, change their order, or restructure the layout.<\/li>\n<li><strong>header.php \/ footer.php<\/strong> \u2014 site-wide header and footer markup.<\/li>\n<li><strong>single.php<\/strong> \u2014 single blog post layout.<\/li>\n<li><strong>archive.php<\/strong> \u2014 the journal\/blog index.<\/li>\n<\/ul>\n<p>Smaller customizations (e.g., changing one section of the firm template) are often easier to do via filters and actions than full template overrides. The Legal theme exposes a few useful hooks:<\/p>\n<h2>Filter and action hooks<\/h2>\n<table>\n<thead>\n<tr>\n<th>Hook<\/th>\n<th>What it does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>legal_dynamic_css<\/code><\/td>\n<td>Filter \u2014 append CSS to the theme&#8217;s inline stylesheet. Used by Pro features.<\/td>\n<\/tr>\n<tr>\n<td><code>legal_fonts_url<\/code><\/td>\n<td>Filter \u2014 replace the Google Fonts URL.<\/td>\n<\/tr>\n<tr>\n<td><code>legal_pro_active<\/code><\/td>\n<td>Filter \u2014 returns whether Legal Pro license is active. Useful for conditionally adding child-theme features that depend on Pro.<\/td>\n<\/tr>\n<tr>\n<td><code>legal_schema_org<\/code><\/td>\n<td>Action \u2014 fires inside <code>&lt;head&gt;<\/code> with LegalService schema markup. Add additional schema by hooking at priority 11+.<\/td>\n<\/tr>\n<tr>\n<td><code>legal_header_extras<\/code><\/td>\n<td>Action \u2014 fires inside the header next to the CTA. Used by Pro for the dark mode toggle. Drop in your own buttons here.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Example \u2014 add a custom CSS rule from your child theme:<\/p>\n<pre><code>add_filter( 'legal_dynamic_css', 'mychambers_extra_css' );\nfunction mychambers_extra_css( $css ) {\n    return $css . \"\n        :root {\n            --lg-accent: #1e3a5f; \/* navy instead of oxblood *\/\n        }\n        .lg-hero { padding-bottom: 8rem; }\n    \";\n}<\/code><\/pre>\n<h2>Adding a new section to the firm page<\/h2>\n<p>The cleanest path: copy <code>template-firm.php<\/code> to your child theme, find the structural comment block where you want to insert your section (the parent template uses clear comment dividers), and add your section there.<\/p>\n<p>Example: adding a &#8220;Press&#8221; section between Counsel and Ledger:<\/p>\n<pre><code>&lt;?php \/* ===== PRESS ===== *\/ ?&gt;\n&lt;section class=\"lg-press\" id=\"press\"&gt;\n    &lt;div class=\"lg-container\"&gt;\n        &lt;div class=\"lg-section-eyebrow\"&gt;Press&lt;\/div&gt;\n        &lt;h2 class=\"lg-section-head\"&gt;\n            &lt;?php esc_html_e( 'Selected coverage,', 'legal-mychambers' ); ?&gt;\n            &lt;em&gt;&lt;?php esc_html_e( 'in the public record.', 'legal-mychambers' ); ?&gt;&lt;\/em&gt;\n        &lt;\/h2&gt;\n        &lt;!-- Your press content here --&gt;\n    &lt;\/div&gt;\n&lt;\/section&gt;<\/code><\/pre>\n<p>Then style it in your child theme&#8217;s <code>style.css<\/code> using Legal&#8217;s existing patterns.<\/p>\n<h2>Things that don&#8217;t need a child theme<\/h2>\n<p>Don&#8217;t reach for a child theme if all you&#8217;re doing is:<\/p>\n<ul>\n<li>Tweaking colors \u2192 use <strong>Additional CSS<\/strong><\/li>\n<li>Replacing copy \u2192 use <strong>Customizer fields<\/strong><\/li>\n<li>Adding tracking scripts \u2192 use a plugin like <em>Insert Headers and Footers<\/em><\/li>\n<li>Adding analytics \u2192 use the Pro plugin&#8217;s analytics module if you have it, or a dedicated plugin<\/li>\n<\/ul>\n<p>Child themes are powerful but add complexity. Use them when you genuinely need template-level overrides or PHP customization, not as the default approach.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When custom CSS isn&#8217;t enough, a child theme lets you override Legal&#8217;s templates, functions, and assets while still receiving theme updates.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[21,20,18],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-customization","tag-advanced","tag-child-theme","tag-customization"],"_links":{"self":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}