<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wordpress templates Archives - Developry Plugins</title>
	<atom:link href="https://developryplugins.com/tag/wordpress-templates/feed/" rel="self" type="application/rss+xml" />
	<link>https://developryplugins.com/tag/wordpress-templates/</link>
	<description></description>
	<lastBuildDate>Mon, 24 Nov 2025 11:18:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://developryplugins.com/wp-content/uploads/2025/11/cropped-favicon-32x32.png</url>
	<title>wordpress templates Archives - Developry Plugins</title>
	<link>https://developryplugins.com/tag/wordpress-templates/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>WordPress Theme Template Hierarchy Explained with Examples</title>
		<link>https://developryplugins.com/wordpress-theme-template-hierarchy-explained-with-examples/</link>
		
		<dc:creator><![CDATA[Krasen Slavov]]></dc:creator>
		<pubDate>Wed, 10 Dec 2025 09:00:00 +0000</pubDate>
				<category><![CDATA[WordPress Theme Development]]></category>
		<category><![CDATA[conditional tags]]></category>
		<category><![CDATA[template files]]></category>
		<category><![CDATA[template hierarchy]]></category>
		<category><![CDATA[theme structure]]></category>
		<category><![CDATA[wordpress templates]]></category>
		<guid isPermaLink="false">https://developryplugins.com/?p=183</guid>

					<description><![CDATA[<p>WordPress template hierarchy determines which PHP template file displays content based on requested URL, following predictable fallback pattern from specific to general templates. From single-post-slug.php specificity to index.php fallback, understanding...</p>
<p>The post <a href="https://developryplugins.com/wordpress-theme-template-hierarchy-explained-with-examples/">WordPress Theme Template Hierarchy Explained with Examples</a> appeared first on <a href="https://developryplugins.com">Developry Plugins</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><!-- @format --></p>
<p>WordPress template hierarchy determines which PHP template file displays content based on requested URL, following predictable fallback pattern from specific to general templates. From single-post-slug.php specificity to index.php fallback, understanding template hierarchy enables precise control over content presentation across post types, taxonomies, and page templates. This comprehensive guide teaches hierarchy visualization, template selection logic, conditional tags, custom template creation, and debugging techniques identifying active templates.</p>
<h2 id="how-template-hierarchy-works">How Template Hierarchy Works</h2>
<p><strong>Request Flow</strong>:</p>
<ol type="1">
<li>User requests URL: <code>example.com/category/news/</code></li>
<li>WordPress identifies request type: Category archive</li>
<li>WordPress searches for templates in order:
<ul>
<li><code>category-news.php</code> (category slug)</li>
<li><code>category-5.php</code> (category ID)</li>
<li><code>category.php</code> (generic category)</li>
<li><code>archive.php</code> (generic archive)</li>
<li><code>index.php</code> (fallback)</li>
</ul>
</li>
<li>First matching template renders content</li>
</ol>
<p><strong>Fallback System</strong>:</p>
<p>WordPress searches from most specific to least specific until finding template file.</p>
<p><strong>Example Hierarchy</strong> (single post):</p>
<pre><code>single-{post-type}-{slug}.php
→ single-{post-type}.php
→ single.php
→ singular.php
→ index.php</code></pre>
<h2 id="index.php---the-fallback">Index.php &#8211; The Fallback</h2>
<p><strong>Ultimate Fallback</strong>:</p>
<p><code>index.php</code> displays content when no specific template exists.</p>
<p><strong>Required</strong>: Every theme must have <code>index.php</code>.</p>
<p><strong>Example index.php</strong>:</p>
<div class="sourceCode" id="cb2">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;main&quot;</span>&gt;</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php</span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true"></a>    <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true"></a>        <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> :</span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true"></a>            the_post<span class="ot">();</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true"></a>            get_template_part<span class="ot">(</span><span class="st">&#39;template-parts/content&#39;</span><span class="ot">,</span> get_post_type<span class="ot">());</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true"></a>        <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true"></a>    <span class="kw">endif</span><span class="ot">;</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true"></a>    <span class="kw">?&gt;</span></span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true"></a></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="single-post-templates">Single Post Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>single-{post-type}-{slug}.php
single-{post-type}.php
single.php
singular.php
index.php</code></pre>
<p><strong>Examples</strong>:</p>
<p>Post slug <code>hello-world</code>:</p>
<ul>
<li><code>single-post-hello-world.php</code> (most specific)</li>
<li><code>single-post.php</code></li>
<li><code>single.php</code></li>
<li><code>singular.php</code></li>
<li><code>index.php</code></li>
</ul>
<p>Custom post type <code>portfolio</code> with slug <code>web-design</code>:</p>
<ul>
<li><code>single-portfolio-web-design.php</code></li>
<li><code>single-portfolio.php</code></li>
<li><code>single.php</code></li>
<li><code>singular.php</code></li>
<li><code>index.php</code></li>
</ul>
<p><strong>single.php</strong>:</p>
<div class="sourceCode" id="cb4">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true"></a>    <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true"></a>        the_post<span class="ot">();</span></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true"></a>        <span class="kw">?&gt;</span></span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true"></a>        &lt;article id=<span class="st">&quot;post-&lt;?php the_ID(); ?&gt;&quot;</span> &lt;<span class="ot">?</span>php post_class<span class="ot">();</span> <span class="kw">?&gt;</span>&gt;</span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true"></a>            &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;entry-header&quot;</span>&gt;</span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_title<span class="ot">(</span><span class="st">&#39;&lt;h1&gt;&#39;</span><span class="ot">,</span> <span class="st">&#39;&lt;/h1&gt;&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true"></a>                &lt;div <span class="kw">class</span>=<span class="st">&quot;entry-meta&quot;</span>&gt;</span>
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true"></a>                    Posted on &lt;<span class="ot">?</span>php <span class="kw">echo</span> get_the_date<span class="ot">();</span> <span class="kw">?&gt;</span> by &lt;<span class="ot">?</span>php the_author<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true"></a>                &lt;/div&gt;</span>
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true"></a>            &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true"></a></span>
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>has_post_thumbnail<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_post_thumbnail<span class="ot">(</span><span class="st">&#39;large&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb4-19"><a href="#cb4-19" aria-hidden="true"></a></span>
<span id="cb4-20"><a href="#cb4-20" aria-hidden="true"></a>            &lt;div <span class="kw">class</span>=<span class="st">&quot;entry-content&quot;</span>&gt;</span>
<span id="cb4-21"><a href="#cb4-21" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_content<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb4-22"><a href="#cb4-22" aria-hidden="true"></a>            &lt;/div&gt;</span>
<span id="cb4-23"><a href="#cb4-23" aria-hidden="true"></a></span>
<span id="cb4-24"><a href="#cb4-24" aria-hidden="true"></a>            &lt;footer <span class="kw">class</span>=<span class="st">&quot;entry-footer&quot;</span>&gt;</span>
<span id="cb4-25"><a href="#cb4-25" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_tags<span class="ot">(</span><span class="st">&#39;&lt;span class=&quot;tags&quot;&gt;&#39;</span><span class="ot">,</span> <span class="st">&#39;, &#39;</span><span class="ot">,</span> <span class="st">&#39;&lt;/span&gt;&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb4-26"><a href="#cb4-26" aria-hidden="true"></a>            &lt;/footer&gt;</span>
<span id="cb4-27"><a href="#cb4-27" aria-hidden="true"></a>        &lt;/article&gt;</span>
<span id="cb4-28"><a href="#cb4-28" aria-hidden="true"></a></span>
<span id="cb4-29"><a href="#cb4-29" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php</span>
<span id="cb4-30"><a href="#cb4-30" aria-hidden="true"></a>        <span class="kw">if</span> <span class="ot">(</span>comments_open<span class="ot">()</span> || get_comments_number<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb4-31"><a href="#cb4-31" aria-hidden="true"></a>            comments_template<span class="ot">();</span></span>
<span id="cb4-32"><a href="#cb4-32" aria-hidden="true"></a>        <span class="kw">endif</span><span class="ot">;</span></span>
<span id="cb4-33"><a href="#cb4-33" aria-hidden="true"></a>    <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb4-34"><a href="#cb4-34" aria-hidden="true"></a>    <span class="kw">?&gt;</span></span>
<span id="cb4-35"><a href="#cb4-35" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb4-36"><a href="#cb4-36" aria-hidden="true"></a></span>
<span id="cb4-37"><a href="#cb4-37" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb4-38"><a href="#cb4-38" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="page-templates">Page Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>{custom-template}.php (selected via admin)
page-{slug}.php
page-{id}.php
page.php
singular.php
index.php</code></pre>
<p><strong>Examples</strong>:</p>
<p>Page slug <code>about</code>:</p>
<ul>
<li>Custom template (if selected in admin)</li>
<li><code>page-about.php</code></li>
<li><code>page-42.php</code> (if page ID is 42)</li>
<li><code>page.php</code></li>
<li><code>singular.php</code></li>
<li><code>index.php</code></li>
</ul>
<p><strong>page.php</strong>:</p>
<div class="sourceCode" id="cb6">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true"></a>    <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true"></a>        the_post<span class="ot">();</span></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true"></a>        <span class="kw">?&gt;</span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true"></a>        &lt;article id=<span class="st">&quot;page-&lt;?php the_ID(); ?&gt;&quot;</span> &lt;<span class="ot">?</span>php post_class<span class="ot">();</span> <span class="kw">?&gt;</span>&gt;</span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true"></a>            &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;entry-header&quot;</span>&gt;</span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_title<span class="ot">(</span><span class="st">&#39;&lt;h1&gt;&#39;</span><span class="ot">,</span> <span class="st">&#39;&lt;/h1&gt;&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true"></a>            &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true"></a></span>
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true"></a>            &lt;div <span class="kw">class</span>=<span class="st">&quot;entry-content&quot;</span>&gt;</span>
<span id="cb6-14"><a href="#cb6-14" aria-hidden="true"></a>                &lt;<span class="ot">?</span>php the_content<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb6-15"><a href="#cb6-15" aria-hidden="true"></a>            &lt;/div&gt;</span>
<span id="cb6-16"><a href="#cb6-16" aria-hidden="true"></a>        &lt;/article&gt;</span>
<span id="cb6-17"><a href="#cb6-17" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endwhile</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb6-18"><a href="#cb6-18" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb6-19"><a href="#cb6-19" aria-hidden="true"></a></span>
<span id="cb6-20"><a href="#cb6-20" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<p><strong>Custom Page Template</strong>:</p>
<p><code>template-fullwidth.php</code>:</p>
<div class="sourceCode" id="cb7">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true"></a><span class="kw">&lt;?php</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true"></a><span class="co">/**</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true"></a><span class="co"> * Template Name: Full Width</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true"></a><span class="co"> * Template Post Type: page, post</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true"></a><span class="co"> */</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true"></a></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true"></a>get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true"></a></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span> <span class="kw">class</span>=<span class="st">&quot;full-width&quot;</span>&gt;</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php</span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true"></a>    <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true"></a>        the_post<span class="ot">();</span></span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true"></a>        the_content<span class="ot">();</span></span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true"></a>    <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true"></a>    <span class="kw">?&gt;</span></span>
<span id="cb7-16"><a href="#cb7-16" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb7-17"><a href="#cb7-17" aria-hidden="true"></a></span>
<span id="cb7-18"><a href="#cb7-18" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<p>Selectable via: Page edit screen → Page Attributes → Template</p>
<h2 id="category-archive-templates">Category Archive Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>category-{slug}.php
category-{id}.php
category.php
archive.php
index.php</code></pre>
<p><strong>Examples</strong>:</p>
<p>Category slug <code>news</code> (ID 5):</p>
<ul>
<li><code>category-news.php</code></li>
<li><code>category-5.php</code></li>
<li><code>category.php</code></li>
<li><code>archive.php</code></li>
<li><code>index.php</code></li>
</ul>
<p><strong>category.php</strong>:</p>
<div class="sourceCode" id="cb9">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true"></a></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true"></a>    &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;page-header&quot;</span>&gt;</span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true"></a>        &lt;h1&gt;&lt;<span class="ot">?</span>php single_cat_title<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/h1&gt;</span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;category-description&quot;</span>&gt;</span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">echo</span> category_description<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true"></a>    &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true"></a></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;posts-list&quot;</span>&gt;</span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php</span>
<span id="cb9-14"><a href="#cb9-14" aria-hidden="true"></a>            <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb9-15"><a href="#cb9-15" aria-hidden="true"></a>                the_post<span class="ot">();</span></span>
<span id="cb9-16"><a href="#cb9-16" aria-hidden="true"></a>                <span class="kw">?&gt;</span></span>
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true"></a>                &lt;article id=<span class="st">&quot;post-&lt;?php the_ID(); ?&gt;&quot;</span> &lt;<span class="ot">?</span>php post_class<span class="ot">();</span> <span class="kw">?&gt;</span>&gt;</span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true"></a>                    &lt;h2&gt;&lt;a href=<span class="st">&quot;&lt;?php the_permalink(); ?&gt;&quot;</span>&gt;&lt;<span class="ot">?</span>php the_title<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;</span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true"></a>                    &lt;div <span class="kw">class</span>=<span class="st">&quot;entry-summary&quot;</span>&gt;</span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true"></a>                        &lt;<span class="ot">?</span>php the_excerpt<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true"></a>                    &lt;/div&gt;</span>
<span id="cb9-22"><a href="#cb9-22" aria-hidden="true"></a>                &lt;/article&gt;</span>
<span id="cb9-23"><a href="#cb9-23" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">endwhile</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb9-24"><a href="#cb9-24" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb9-25"><a href="#cb9-25" aria-hidden="true"></a></span>
<span id="cb9-26"><a href="#cb9-26" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php the_posts_pagination<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb9-27"><a href="#cb9-27" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">else</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb9-28"><a href="#cb9-28" aria-hidden="true"></a>        &lt;p&gt;No posts found in this category.&lt;/p&gt;</span>
<span id="cb9-29"><a href="#cb9-29" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb9-30"><a href="#cb9-30" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb9-31"><a href="#cb9-31" aria-hidden="true"></a></span>
<span id="cb9-32"><a href="#cb9-32" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb9-33"><a href="#cb9-33" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="tag-archive-templates">Tag Archive Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>tag-{slug}.php
tag-{id}.php
tag.php
archive.php
index.php</code></pre>
<p><strong>Examples</strong>:</p>
<p>Tag slug <code>wordpress</code> (ID 10):</p>
<ul>
<li><code>tag-wordpress.php</code></li>
<li><code>tag-10.php</code></li>
<li><code>tag.php</code></li>
<li><code>archive.php</code></li>
<li><code>index.php</code></li>
</ul>
<h2 id="custom-post-type-archives">Custom Post Type Archives</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>archive-{post-type}.php
archive.php
index.php</code></pre>
<p><strong>Example</strong>:</p>
<p>Portfolio post type:</p>
<ul>
<li><code>archive-portfolio.php</code></li>
<li><code>archive.php</code></li>
<li><code>index.php</code></li>
</ul>
<p><strong>archive-portfolio.php</strong>:</p>
<div class="sourceCode" id="cb12">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true"></a></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true"></a>    &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;page-header&quot;</span>&gt;</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true"></a>        &lt;h1&gt;Portfolio&lt;/h1&gt;</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true"></a>    &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true"></a></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;portfolio-grid&quot;</span>&gt;</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true"></a>            <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true"></a>                the_post<span class="ot">();</span></span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true"></a>                <span class="kw">?&gt;</span></span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true"></a>                &lt;div <span class="kw">class</span>=<span class="st">&quot;portfolio-item&quot;</span>&gt;</span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true"></a>                    &lt;a href=<span class="st">&quot;&lt;?php the_permalink(); ?&gt;&quot;</span>&gt;</span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true"></a>                        &lt;<span class="ot">?</span>php the_post_thumbnail<span class="ot">(</span><span class="st">&#39;medium&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true"></a>                        &lt;h3&gt;&lt;<span class="ot">?</span>php the_title<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/h3&gt;</span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true"></a>                    &lt;/a&gt;</span>
<span id="cb12-19"><a href="#cb12-19" aria-hidden="true"></a>                &lt;/div&gt;</span>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">endwhile</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb12-21"><a href="#cb12-21" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb12-22"><a href="#cb12-22" aria-hidden="true"></a></span>
<span id="cb12-23"><a href="#cb12-23" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php the_posts_pagination<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb12-24"><a href="#cb12-24" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb12-25"><a href="#cb12-25" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb12-26"><a href="#cb12-26" aria-hidden="true"></a></span>
<span id="cb12-27"><a href="#cb12-27" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="custom-taxonomy-templates">Custom Taxonomy Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>taxonomy-{taxonomy}-{term}.php
taxonomy-{taxonomy}.php
taxonomy.php
archive.php
index.php</code></pre>
<p><strong>Example</strong>:</p>
<p>Taxonomy <code>portfolio_category</code>, term <code>web-design</code>:</p>
<ul>
<li><code>taxonomy-portfolio_category-web-design.php</code></li>
<li><code>taxonomy-portfolio_category.php</code></li>
<li><code>taxonomy.php</code></li>
<li><code>archive.php</code></li>
<li><code>index.php</code></li>
</ul>
<h2 id="author-archive-templates">Author Archive Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>author-{nicename}.php
author-{id}.php
author.php
archive.php
index.php</code></pre>
<p><strong>author.php</strong>:</p>
<div class="sourceCode" id="cb15">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true"></a></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true"></a>    &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;author-header&quot;</span>&gt;</span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;author-avatar&quot;</span>&gt;</span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="kw">echo</span> get_avatar<span class="ot">(</span>get_the_author_meta<span class="ot">(</span><span class="st">&#39;ID&#39;</span><span class="ot">),</span> <span class="dv">150</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;author-info&quot;</span>&gt;</span>
<span id="cb15-9"><a href="#cb15-9" aria-hidden="true"></a>            &lt;h1&gt;&lt;<span class="ot">?</span>php <span class="kw">echo</span> get_the_author<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/h1&gt;</span>
<span id="cb15-10"><a href="#cb15-10" aria-hidden="true"></a>            &lt;p <span class="kw">class</span>=<span class="st">&quot;author-bio&quot;</span>&gt;&lt;<span class="ot">?</span>php <span class="kw">echo</span> get_the_author_meta<span class="ot">(</span><span class="st">&#39;description&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span>&lt;/p&gt;</span>
<span id="cb15-11"><a href="#cb15-11" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb15-12"><a href="#cb15-12" aria-hidden="true"></a>    &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb15-13"><a href="#cb15-13" aria-hidden="true"></a></span>
<span id="cb15-14"><a href="#cb15-14" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb15-15"><a href="#cb15-15" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;author-posts&quot;</span>&gt;</span>
<span id="cb15-16"><a href="#cb15-16" aria-hidden="true"></a>            &lt;h2&gt;Posts by &lt;<span class="ot">?</span>php <span class="kw">echo</span> get_the_author<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/h2&gt;</span>
<span id="cb15-17"><a href="#cb15-17" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php</span>
<span id="cb15-18"><a href="#cb15-18" aria-hidden="true"></a>            <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb15-19"><a href="#cb15-19" aria-hidden="true"></a>                the_post<span class="ot">();</span></span>
<span id="cb15-20"><a href="#cb15-20" aria-hidden="true"></a>                get_template_part<span class="ot">(</span><span class="st">&#39;template-parts/content&#39;</span><span class="ot">,</span> <span class="st">&#39;excerpt&#39;</span><span class="ot">);</span></span>
<span id="cb15-21"><a href="#cb15-21" aria-hidden="true"></a>            <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb15-22"><a href="#cb15-22" aria-hidden="true"></a>            <span class="kw">?&gt;</span></span>
<span id="cb15-23"><a href="#cb15-23" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb15-24"><a href="#cb15-24" aria-hidden="true"></a></span>
<span id="cb15-25"><a href="#cb15-25" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php the_posts_pagination<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb15-26"><a href="#cb15-26" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb15-27"><a href="#cb15-27" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb15-28"><a href="#cb15-28" aria-hidden="true"></a></span>
<span id="cb15-29"><a href="#cb15-29" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb15-30"><a href="#cb15-30" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="date-archive-templates">Date Archive Templates</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>date.php
archive.php
index.php</code></pre>
<p><strong>date.php</strong>:</p>
<div class="sourceCode" id="cb17">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true"></a></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true"></a>    &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;page-header&quot;</span>&gt;</span>
<span id="cb17-5"><a href="#cb17-5" aria-hidden="true"></a>        &lt;h1&gt;</span>
<span id="cb17-6"><a href="#cb17-6" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php</span>
<span id="cb17-7"><a href="#cb17-7" aria-hidden="true"></a>            <span class="kw">if</span> <span class="ot">(</span>is_day<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb17-8"><a href="#cb17-8" aria-hidden="true"></a>                <span class="fu">printf</span><span class="ot">(</span><span class="st">&#39;Archives: %s&#39;</span><span class="ot">,</span> get_the_date<span class="ot">());</span></span>
<span id="cb17-9"><a href="#cb17-9" aria-hidden="true"></a>            <span class="kw">elseif</span> <span class="ot">(</span>is_month<span class="ot">())</span> :</span>
<span id="cb17-10"><a href="#cb17-10" aria-hidden="true"></a>                <span class="fu">printf</span><span class="ot">(</span><span class="st">&#39;Archives: %s&#39;</span><span class="ot">,</span> get_the_date<span class="ot">(</span><span class="st">&#39;F Y&#39;</span><span class="ot">));</span></span>
<span id="cb17-11"><a href="#cb17-11" aria-hidden="true"></a>            <span class="kw">elseif</span> <span class="ot">(</span>is_year<span class="ot">())</span> :</span>
<span id="cb17-12"><a href="#cb17-12" aria-hidden="true"></a>                <span class="fu">printf</span><span class="ot">(</span><span class="st">&#39;Archives: %s&#39;</span><span class="ot">,</span> get_the_date<span class="ot">(</span><span class="st">&#39;Y&#39;</span><span class="ot">));</span></span>
<span id="cb17-13"><a href="#cb17-13" aria-hidden="true"></a>            <span class="kw">endif</span><span class="ot">;</span></span>
<span id="cb17-14"><a href="#cb17-14" aria-hidden="true"></a>            <span class="kw">?&gt;</span></span>
<span id="cb17-15"><a href="#cb17-15" aria-hidden="true"></a>        &lt;/h1&gt;</span>
<span id="cb17-16"><a href="#cb17-16" aria-hidden="true"></a>    &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb17-17"><a href="#cb17-17" aria-hidden="true"></a></span>
<span id="cb17-18"><a href="#cb17-18" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb17-19"><a href="#cb17-19" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php</span>
<span id="cb17-20"><a href="#cb17-20" aria-hidden="true"></a>        <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb17-21"><a href="#cb17-21" aria-hidden="true"></a>            the_post<span class="ot">();</span></span>
<span id="cb17-22"><a href="#cb17-22" aria-hidden="true"></a>            get_template_part<span class="ot">(</span><span class="st">&#39;template-parts/content&#39;</span><span class="ot">,</span> <span class="st">&#39;archive&#39;</span><span class="ot">);</span></span>
<span id="cb17-23"><a href="#cb17-23" aria-hidden="true"></a>        <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb17-24"><a href="#cb17-24" aria-hidden="true"></a>        <span class="kw">?&gt;</span></span>
<span id="cb17-25"><a href="#cb17-25" aria-hidden="true"></a></span>
<span id="cb17-26"><a href="#cb17-26" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php the_posts_pagination<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb17-27"><a href="#cb17-27" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb17-28"><a href="#cb17-28" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb17-29"><a href="#cb17-29" aria-hidden="true"></a></span>
<span id="cb17-30"><a href="#cb17-30" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb17-31"><a href="#cb17-31" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="search-results-template">Search Results Template</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>search.php
index.php</code></pre>
<p><strong>search.php</strong>:</p>
<div class="sourceCode" id="cb19">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true"></a></span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true"></a>    &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;page-header&quot;</span>&gt;</span>
<span id="cb19-5"><a href="#cb19-5" aria-hidden="true"></a>        &lt;h1&gt;</span>
<span id="cb19-6"><a href="#cb19-6" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php <span class="fu">printf</span><span class="ot">(</span><span class="st">&#39;Search Results for: %s&#39;</span><span class="ot">,</span> <span class="st">&#39;&lt;span&gt;&#39;</span> . get_search_query<span class="ot">()</span> . <span class="st">&#39;&lt;/span&gt;&#39;</span><span class="ot">);</span> <span class="kw">?&gt;</span></span>
<span id="cb19-7"><a href="#cb19-7" aria-hidden="true"></a>        &lt;/h1&gt;</span>
<span id="cb19-8"><a href="#cb19-8" aria-hidden="true"></a>    &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb19-9"><a href="#cb19-9" aria-hidden="true"></a></span>
<span id="cb19-10"><a href="#cb19-10" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">if</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb19-11"><a href="#cb19-11" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php</span>
<span id="cb19-12"><a href="#cb19-12" aria-hidden="true"></a>        <span class="kw">while</span> <span class="ot">(</span>have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb19-13"><a href="#cb19-13" aria-hidden="true"></a>            the_post<span class="ot">();</span></span>
<span id="cb19-14"><a href="#cb19-14" aria-hidden="true"></a>            <span class="kw">?&gt;</span></span>
<span id="cb19-15"><a href="#cb19-15" aria-hidden="true"></a>            &lt;article&gt;</span>
<span id="cb19-16"><a href="#cb19-16" aria-hidden="true"></a>                &lt;h2&gt;&lt;a href=<span class="st">&quot;&lt;?php the_permalink(); ?&gt;&quot;</span>&gt;&lt;<span class="ot">?</span>php the_title<span class="ot">();</span> <span class="kw">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;</span>
<span id="cb19-17"><a href="#cb19-17" aria-hidden="true"></a>                &lt;div <span class="kw">class</span>=<span class="st">&quot;entry-summary&quot;</span>&gt;</span>
<span id="cb19-18"><a href="#cb19-18" aria-hidden="true"></a>                    &lt;<span class="ot">?</span>php the_excerpt<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb19-19"><a href="#cb19-19" aria-hidden="true"></a>                &lt;/div&gt;</span>
<span id="cb19-20"><a href="#cb19-20" aria-hidden="true"></a>            &lt;/article&gt;</span>
<span id="cb19-21"><a href="#cb19-21" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php <span class="kw">endwhile</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb19-22"><a href="#cb19-22" aria-hidden="true"></a></span>
<span id="cb19-23"><a href="#cb19-23" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php the_posts_pagination<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb19-24"><a href="#cb19-24" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">else</span> <span class="ot">:</span> <span class="kw">?&gt;</span></span>
<span id="cb19-25"><a href="#cb19-25" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;no-results&quot;</span>&gt;</span>
<span id="cb19-26"><a href="#cb19-26" aria-hidden="true"></a>            &lt;p&gt;No results found. Please <span class="kw">try</span> different keywords.&lt;/p&gt;</span>
<span id="cb19-27"><a href="#cb19-27" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php get_search_form<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb19-28"><a href="#cb19-28" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb19-29"><a href="#cb19-29" aria-hidden="true"></a>    &lt;<span class="ot">?</span>php <span class="kw">endif</span><span class="ot">;</span> <span class="kw">?&gt;</span></span>
<span id="cb19-30"><a href="#cb19-30" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb19-31"><a href="#cb19-31" aria-hidden="true"></a></span>
<span id="cb19-32"><a href="#cb19-32" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_sidebar<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb19-33"><a href="#cb19-33" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="error-template">404 Error Template</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>404.php
index.php</code></pre>
<p><strong>404.php</strong>:</p>
<div class="sourceCode" id="cb21">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true"></a></span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span>&gt;</span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true"></a>    &lt;section <span class="kw">class</span>=<span class="st">&quot;error-404&quot;</span>&gt;</span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true"></a>        &lt;<span class="fu">header</span> <span class="kw">class</span>=<span class="st">&quot;page-header&quot;</span>&gt;</span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true"></a>            &lt;h1&gt;<span class="dv">404</span>: Page Not Found&lt;/h1&gt;</span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true"></a>        &lt;/<span class="fu">header</span>&gt;</span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true"></a></span>
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true"></a>        &lt;div <span class="kw">class</span>=<span class="st">&quot;page-content&quot;</span>&gt;</span>
<span id="cb21-10"><a href="#cb21-10" aria-hidden="true"></a>            &lt;p&gt;The page you are looking <span class="kw">for</span> might have been removed<span class="ot">,</span> had its name changed<span class="ot">,</span> <span class="kw">or</span> is temporarily unavailable.&lt;/p&gt;</span>
<span id="cb21-11"><a href="#cb21-11" aria-hidden="true"></a></span>
<span id="cb21-12"><a href="#cb21-12" aria-hidden="true"></a>            &lt;h2&gt;<span class="kw">Try</span> searching:&lt;/h2&gt;</span>
<span id="cb21-13"><a href="#cb21-13" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php get_search_form<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb21-14"><a href="#cb21-14" aria-hidden="true"></a></span>
<span id="cb21-15"><a href="#cb21-15" aria-hidden="true"></a>            &lt;h2&gt;Popular Posts:&lt;/h2&gt;</span>
<span id="cb21-16"><a href="#cb21-16" aria-hidden="true"></a>            &lt;<span class="ot">?</span>php</span>
<span id="cb21-17"><a href="#cb21-17" aria-hidden="true"></a>            <span class="kw">$popular</span> = <span class="kw">new</span> WP_Query<span class="ot">(</span><span class="kw">array</span><span class="ot">(</span></span>
<span id="cb21-18"><a href="#cb21-18" aria-hidden="true"></a>                <span class="st">&#39;posts_per_page&#39;</span> =&gt; <span class="dv">5</span><span class="ot">,</span></span>
<span id="cb21-19"><a href="#cb21-19" aria-hidden="true"></a>                <span class="st">&#39;orderby&#39;</span> =&gt; <span class="st">&#39;comment_count&#39;</span></span>
<span id="cb21-20"><a href="#cb21-20" aria-hidden="true"></a>            <span class="ot">));</span></span>
<span id="cb21-21"><a href="#cb21-21" aria-hidden="true"></a></span>
<span id="cb21-22"><a href="#cb21-22" aria-hidden="true"></a>            <span class="kw">if</span> <span class="ot">(</span><span class="kw">$popular</span>-&gt;have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb21-23"><a href="#cb21-23" aria-hidden="true"></a>                <span class="kw">echo</span> <span class="st">&#39;&lt;ul&gt;&#39;</span><span class="ot">;</span></span>
<span id="cb21-24"><a href="#cb21-24" aria-hidden="true"></a>                <span class="kw">while</span> <span class="ot">(</span><span class="kw">$popular</span>-&gt;have_posts<span class="ot">())</span> :</span>
<span id="cb21-25"><a href="#cb21-25" aria-hidden="true"></a>                    <span class="kw">$popular</span>-&gt;the_post<span class="ot">();</span></span>
<span id="cb21-26"><a href="#cb21-26" aria-hidden="true"></a>                    <span class="kw">echo</span> <span class="st">&#39;&lt;li&gt;&lt;a href=&quot;&#39;</span> . get_permalink<span class="ot">()</span> . <span class="st">&#39;&quot;&gt;&#39;</span> . get_the_title<span class="ot">()</span> . <span class="st">&#39;&lt;/a&gt;&lt;/li&gt;&#39;</span><span class="ot">;</span></span>
<span id="cb21-27"><a href="#cb21-27" aria-hidden="true"></a>                <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb21-28"><a href="#cb21-28" aria-hidden="true"></a>                <span class="kw">echo</span> <span class="st">&#39;&lt;/ul&gt;&#39;</span><span class="ot">;</span></span>
<span id="cb21-29"><a href="#cb21-29" aria-hidden="true"></a>                wp_reset_postdata<span class="ot">();</span></span>
<span id="cb21-30"><a href="#cb21-30" aria-hidden="true"></a>            <span class="kw">endif</span><span class="ot">;</span></span>
<span id="cb21-31"><a href="#cb21-31" aria-hidden="true"></a>            <span class="kw">?&gt;</span></span>
<span id="cb21-32"><a href="#cb21-32" aria-hidden="true"></a>        &lt;/div&gt;</span>
<span id="cb21-33"><a href="#cb21-33" aria-hidden="true"></a>    &lt;/section&gt;</span>
<span id="cb21-34"><a href="#cb21-34" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb21-35"><a href="#cb21-35" aria-hidden="true"></a></span>
<span id="cb21-36"><a href="#cb21-36" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="attachment-template">Attachment Template</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>{MIME_type}.php (image.php, video.php, application.php)
attachment.php
single-attachment-{slug}.php
single-attachment.php
single.php
singular.php
index.php</code></pre>
<h2 id="front-page-template">Front Page Template</h2>
<p><strong>Hierarchy</strong>:</p>
<pre><code>front-page.php
home.php (if front page displays posts)
page.php (if static front page set)
index.php</code></pre>
<p><strong>front-page.php</strong>:</p>
<div class="sourceCode" id="cb24">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true"></a><span class="kw">&lt;?php</span> get_header<span class="ot">();</span> <span class="kw">?&gt;</span></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true"></a></span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true"></a>&lt;main id=<span class="st">&quot;primary&quot;</span> <span class="kw">class</span>=<span class="st">&quot;front-page&quot;</span>&gt;</span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true"></a>    &lt;section <span class="kw">class</span>=<span class="st">&quot;hero&quot;</span>&gt;</span>
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true"></a>        &lt;h1&gt;Welcome to Our Website&lt;/h1&gt;</span>
<span id="cb24-6"><a href="#cb24-6" aria-hidden="true"></a>        &lt;p&gt;Featured content here&lt;/p&gt;</span>
<span id="cb24-7"><a href="#cb24-7" aria-hidden="true"></a>    &lt;/section&gt;</span>
<span id="cb24-8"><a href="#cb24-8" aria-hidden="true"></a></span>
<span id="cb24-9"><a href="#cb24-9" aria-hidden="true"></a>    &lt;section <span class="kw">class</span>=<span class="st">&quot;recent-posts&quot;</span>&gt;</span>
<span id="cb24-10"><a href="#cb24-10" aria-hidden="true"></a>        &lt;h2&gt;Latest Posts&lt;/h2&gt;</span>
<span id="cb24-11"><a href="#cb24-11" aria-hidden="true"></a>        &lt;<span class="ot">?</span>php</span>
<span id="cb24-12"><a href="#cb24-12" aria-hidden="true"></a>        <span class="kw">$recent_posts</span> = <span class="kw">new</span> WP_Query<span class="ot">(</span><span class="kw">array</span><span class="ot">(</span></span>
<span id="cb24-13"><a href="#cb24-13" aria-hidden="true"></a>            <span class="st">&#39;posts_per_page&#39;</span> =&gt; <span class="dv">3</span><span class="ot">,</span></span>
<span id="cb24-14"><a href="#cb24-14" aria-hidden="true"></a>        <span class="ot">));</span></span>
<span id="cb24-15"><a href="#cb24-15" aria-hidden="true"></a></span>
<span id="cb24-16"><a href="#cb24-16" aria-hidden="true"></a>        <span class="kw">if</span> <span class="ot">(</span><span class="kw">$recent_posts</span>-&gt;have_posts<span class="ot">())</span> <span class="ot">:</span></span>
<span id="cb24-17"><a href="#cb24-17" aria-hidden="true"></a>            <span class="kw">while</span> <span class="ot">(</span><span class="kw">$recent_posts</span>-&gt;have_posts<span class="ot">())</span> :</span>
<span id="cb24-18"><a href="#cb24-18" aria-hidden="true"></a>                <span class="kw">$recent_posts</span>-&gt;the_post<span class="ot">();</span></span>
<span id="cb24-19"><a href="#cb24-19" aria-hidden="true"></a>                get_template_part<span class="ot">(</span><span class="st">&#39;template-parts/content&#39;</span><span class="ot">,</span> <span class="st">&#39;excerpt&#39;</span><span class="ot">);</span></span>
<span id="cb24-20"><a href="#cb24-20" aria-hidden="true"></a>            <span class="kw">endwhile</span><span class="ot">;</span></span>
<span id="cb24-21"><a href="#cb24-21" aria-hidden="true"></a>            wp_reset_postdata<span class="ot">();</span></span>
<span id="cb24-22"><a href="#cb24-22" aria-hidden="true"></a>        <span class="kw">endif</span><span class="ot">;</span></span>
<span id="cb24-23"><a href="#cb24-23" aria-hidden="true"></a>        <span class="kw">?&gt;</span></span>
<span id="cb24-24"><a href="#cb24-24" aria-hidden="true"></a>    &lt;/section&gt;</span>
<span id="cb24-25"><a href="#cb24-25" aria-hidden="true"></a>&lt;/main&gt;</span>
<span id="cb24-26"><a href="#cb24-26" aria-hidden="true"></a></span>
<span id="cb24-27"><a href="#cb24-27" aria-hidden="true"></a>&lt;<span class="ot">?</span>php get_footer<span class="ot">();</span> <span class="kw">?&gt;</span></span></code></pre>
</div>
<h2 id="debugging-template-hierarchy">Debugging Template Hierarchy</h2>
<p><strong>Show Active Template</strong>:</p>
<div class="sourceCode" id="cb25">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true"></a><span class="co">// Add to functions.php</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true"></a>add_filter<span class="ot">(</span><span class="st">&#39;template_include&#39;</span><span class="ot">,</span> <span class="kw">function</span><span class="ot">(</span><span class="kw">$template</span><span class="ot">)</span> {</span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true"></a>    <span class="kw">if</span> <span class="ot">(</span>current_user_can<span class="ot">(</span><span class="st">&#39;manage_options&#39;</span><span class="ot">))</span> {</span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true"></a>        <span class="kw">echo</span> <span class="st">&#39;&lt;!-- Template: &#39;</span> . <span class="fu">basename</span><span class="ot">(</span><span class="kw">$template</span><span class="ot">)</span> . <span class="st">&#39; --&gt;&#39;</span><span class="ot">;</span></span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true"></a>    }</span>
<span id="cb25-6"><a href="#cb25-6" aria-hidden="true"></a>    <span class="kw">return</span> <span class="kw">$template</span><span class="ot">;</span></span>
<span id="cb25-7"><a href="#cb25-7" aria-hidden="true"></a>}<span class="ot">);</span></span></code></pre>
</div>
<p><strong>Query Monitor Plugin</strong>:</p>
<p>Install Query Monitor plugin to see:</p>
<ul>
<li>Active template file</li>
<li>Template hierarchy checked</li>
<li>Conditional tags active</li>
</ul>
<p><strong>Conditional Tags</strong>:</p>
<p>Determine current page type:</p>
<div class="sourceCode" id="cb26">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true"></a>is_home<span class="ot">()</span>           <span class="co">// Blog posts index</span></span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true"></a>is_front_page<span class="ot">()</span>     <span class="co">// Front page (static or posts)</span></span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true"></a>is_single<span class="ot">()</span>         <span class="co">// Single post</span></span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true"></a>is_page<span class="ot">()</span>           <span class="co">// Single page</span></span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true"></a>is_category<span class="ot">()</span>       <span class="co">// Category archive</span></span>
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true"></a>is_tag<span class="ot">()</span>            <span class="co">// Tag archive</span></span>
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true"></a>is_tax<span class="ot">()</span>            <span class="co">// Custom taxonomy archive</span></span>
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true"></a>is_author<span class="ot">()</span>         <span class="co">// Author archive</span></span>
<span id="cb26-9"><a href="#cb26-9" aria-hidden="true"></a>is_date<span class="ot">()</span>           <span class="co">// Date archive</span></span>
<span id="cb26-10"><a href="#cb26-10" aria-hidden="true"></a>is_search<span class="ot">()</span>         <span class="co">// Search results</span></span>
<span id="cb26-11"><a href="#cb26-11" aria-hidden="true"></a>is_404<span class="ot">()</span>            <span class="co">// 404 error</span></span>
<span id="cb26-12"><a href="#cb26-12" aria-hidden="true"></a>is_archive<span class="ot">()</span>        <span class="co">// Any archive</span></span>
<span id="cb26-13"><a href="#cb26-13" aria-hidden="true"></a>is_singular<span class="ot">()</span>       <span class="co">// Single post or page</span></span></code></pre>
</div>
<h2 id="conclusion">Conclusion</h2>
<p>WordPress template hierarchy determines content display through systematic fallback from specific to general template files. Master single post hierarchy flowing from post-slug specificity to index.php fallback, understand archive template selection for categories, tags, and custom taxonomies, create custom page templates with Template Name headers, and utilize conditional tags identifying page types. Template hierarchy provides predictable template selection enabling precise control over WordPress content presentation across all post types and request types.</p>
<h2 id="external-links">External Links</h2>
<ol type="1">
<li><a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">Template Hierarchy Documentation</a></li>
<li><a href="https://developer.wordpress.org/themes/basics/conditional-tags/">Conditional Tags Reference</a></li>
<li><a href="https://developer.wordpress.org/themes/basics/template-files/">Template Files List</a></li>
<li><a href="https://wordpress.org/plugins/query-monitor/">Query Monitor Plugin</a></li>
<li><a href="https://developer.wordpress.org/files/2014/10/Screenshot-2019-01-23.00.20.04.png">Interactive Template Hierarchy</a></li>
</ol>
<h2 id="call-to-action">Call to Action</h2>
<p>Theme customizations need reliable backups. <a href="https://backupcopilotplugin.com/">Backup Copilot Pro</a> protects your WordPress theme files automatically. Safeguard your template modifications—start your free 30-day trial today!</p>
<p>The post <a href="https://developryplugins.com/wordpress-theme-template-hierarchy-explained-with-examples/">WordPress Theme Template Hierarchy Explained with Examples</a> appeared first on <a href="https://developryplugins.com">Developry Plugins</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress Block Templates: Streamline Content Creation Workflows</title>
		<link>https://developryplugins.com/wordpress-block-templates-streamline-content-creation-workflows/</link>
		
		<dc:creator><![CDATA[Krasen Slavov]]></dc:creator>
		<pubDate>Thu, 20 Nov 2025 09:00:00 +0000</pubDate>
				<category><![CDATA[Block Editor & Gutenberg Tutorials]]></category>
		<category><![CDATA[block templates]]></category>
		<category><![CDATA[content workflows]]></category>
		<category><![CDATA[gutenberg templates]]></category>
		<category><![CDATA[post templates]]></category>
		<category><![CDATA[wordpress templates]]></category>
		<guid isPermaLink="false">https://developryplugins.com/?p=159</guid>

					<description><![CDATA[<p>Block templates revolutionize WordPress content workflows by pre-defining block structures for posts, pages, and custom post types. Instead of starting with a blank canvas, content creators begin with purposefully designed...</p>
<p>The post <a href="https://developryplugins.com/wordpress-block-templates-streamline-content-creation-workflows/">WordPress Block Templates: Streamline Content Creation Workflows</a> appeared first on <a href="https://developryplugins.com">Developry Plugins</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><!-- @format --></p>
<p>Block templates revolutionize WordPress content workflows by pre-defining block structures for posts, pages, and custom post types. Instead of starting with a blank canvas, content creators begin with purposefully designed templates that ensure consistency and accelerate publishing.</p>
<h2 id="what-are-block-templates">What Are Block Templates?</h2>
<p>Block templates define the initial block structure when creating new content. They’re pre-configured block arrangements that appear when you create a new post, page, or custom post type entry.</p>
<p>Think of block templates as blueprints. When creating a new “Product” post, a template might automatically include an image block, heading, price field, description paragraphs, and feature list—everything needed for consistent product pages.</p>
<h2 id="benefits-of-block-templates">Benefits of Block Templates</h2>
<p>Block templates deliver measurable workflow improvements:</p>
<p><strong>Consistency</strong> &#8211; Every post type follows the same structure, maintaining brand standards across all content. New team members create properly formatted content from day one.</p>
<p><strong>Speed</strong> &#8211; Content creators spend zero time setting up block structure. They focus entirely on writing content, not arranging blocks.</p>
<p><strong>Guidance</strong> &#8211; Templates with placeholder text guide creators on what content goes where, reducing questions and revisions.</p>
<p><strong>Quality control</strong> &#8211; Required blocks ensure essential content never gets forgotten. Product pages always include images, pricing, and descriptions.</p>
<h2 id="templates-vs-patterns-vs-reusable-blocks">Templates vs Patterns vs Reusable Blocks</h2>
<p>Understanding the differences helps you choose the right tool:</p>
<p><strong>Block templates</strong> apply automatically when creating new content. Users can modify or remove blocks as needed.</p>
<p><strong>Block patterns</strong> are insertable block arrangements available from the inserter. Users manually add them to content.</p>
<p><strong>Reusable blocks</strong> are synced content that updates across all instances. Changes propagate everywhere the block appears.</p>
<p>Use templates for automatic post structure, patterns for optional insertable layouts, and reusable blocks for synchronized content.</p>
<h2 id="creating-block-templates-for-custom-post-types">Creating Block Templates for Custom Post Types</h2>
<p>Register block templates when defining custom post types:</p>
<div class="sourceCode" id="cb1">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="kw">function</span> dprt_register_product_post_type<span class="ot">()</span> {</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a>    <span class="kw">$template</span> = <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/image&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a>            <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Add product image&#39;</span><span class="ot">,</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a>            <span class="st">&#39;align&#39;</span> =&gt; <span class="st">&#39;wide&#39;</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a>        <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true"></a>            <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Product Name&#39;</span><span class="ot">,</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true"></a>            <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true"></a>        <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true"></a>            <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Enter product description...&#39;</span></span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true"></a>        <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/columns&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true"></a>            <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/column&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true"></a>                    <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Features&#39;</span><span class="ot">,</span></span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true"></a>                    <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">3</span></span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true"></a>                <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/list&#39;</span> <span class="ot">)</span></span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true"></a>            <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true"></a>            <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/column&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true"></a>                    <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Specifications&#39;</span><span class="ot">,</span></span>
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true"></a>                    <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">3</span></span>
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true"></a>                <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/list&#39;</span> <span class="ot">)</span></span>
<span id="cb1-28"><a href="#cb1-28" aria-hidden="true"></a>            <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb1-29"><a href="#cb1-29" aria-hidden="true"></a>        <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb1-30"><a href="#cb1-30" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/buttons&#39;</span> <span class="ot">)</span></span>
<span id="cb1-31"><a href="#cb1-31" aria-hidden="true"></a>    <span class="ot">);</span></span>
<span id="cb1-32"><a href="#cb1-32" aria-hidden="true"></a></span>
<span id="cb1-33"><a href="#cb1-33" aria-hidden="true"></a>    register_post_type<span class="ot">(</span> <span class="st">&#39;product&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-34"><a href="#cb1-34" aria-hidden="true"></a>        <span class="st">&#39;labels&#39;</span> =&gt; <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb1-35"><a href="#cb1-35" aria-hidden="true"></a>            <span class="st">&#39;name&#39;</span> =&gt; <span class="st">&#39;Products&#39;</span></span>
<span id="cb1-36"><a href="#cb1-36" aria-hidden="true"></a>        <span class="ot">),</span></span>
<span id="cb1-37"><a href="#cb1-37" aria-hidden="true"></a>        <span class="st">&#39;public&#39;</span> =&gt; <span class="kw">true</span><span class="ot">,</span></span>
<span id="cb1-38"><a href="#cb1-38" aria-hidden="true"></a>        <span class="st">&#39;template&#39;</span> =&gt; <span class="kw">$template</span><span class="ot">,</span></span>
<span id="cb1-39"><a href="#cb1-39" aria-hidden="true"></a>        <span class="st">&#39;template_lock&#39;</span> =&gt; <span class="st">&#39;all&#39;</span><span class="ot">,</span></span>
<span id="cb1-40"><a href="#cb1-40" aria-hidden="true"></a>        <span class="st">&#39;supports&#39;</span> =&gt; <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;title&#39;</span><span class="ot">,</span> <span class="st">&#39;editor&#39;</span><span class="ot">,</span> <span class="st">&#39;thumbnail&#39;</span> <span class="ot">)</span></span>
<span id="cb1-41"><a href="#cb1-41" aria-hidden="true"></a>    <span class="ot">)</span> <span class="ot">);</span></span>
<span id="cb1-42"><a href="#cb1-42" aria-hidden="true"></a>}</span>
<span id="cb1-43"><a href="#cb1-43" aria-hidden="true"></a>add_action<span class="ot">(</span> <span class="st">&#39;init&#39;</span><span class="ot">,</span> <span class="st">&#39;dprt_register_product_post_type&#39;</span> <span class="ot">);</span></span></code></pre>
</div>
<p>This template ensures every product post starts with the same structure.</p>
<h2 id="template-locking-options">Template Locking Options</h2>
<p>Control how users can modify templates with the <code>template_lock</code> argument:</p>
<p><strong>‘all’</strong> &#8211; Users cannot add, remove, or move blocks. They can only edit existing block content. Perfect for strict templates where structure must never change.</p>
<p><strong>‘insert’</strong> &#8211; Users can edit and move blocks but cannot add new ones. Maintains intended block set while allowing reorganization.</p>
<p><strong>‘contentOnly’</strong> &#8211; Users can only edit text content. Block settings and structure are locked. Ideal for non-technical users.</p>
<p><strong>false</strong> (default) &#8211; No restrictions. Users have complete freedom to modify the template.</p>
<p>Choose based on your workflow requirements and user technical level.</p>
<h2 id="nested-block-templates">Nested Block Templates</h2>
<p>Templates support complex nested structures:</p>
<div class="sourceCode" id="cb2">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="kw">$template</span> = <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/group&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a>        <span class="st">&#39;className&#39;</span> =&gt; <span class="st">&#39;product-header&#39;</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a>    <span class="ot">),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true"></a>        <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/columns&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true"></a>            <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/column&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;width&#39;</span> =&gt; <span class="st">&#39;66.66%&#39;</span> <span class="ot">),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true"></a>                    <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Product Title&#39;</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true"></a>                <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true"></a>                    <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Short description&#39;</span></span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true"></a>                <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true"></a>            <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true"></a>            <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/column&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;width&#39;</span> =&gt; <span class="st">&#39;33.33%&#39;</span> <span class="ot">),</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true"></a>                <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/image&#39;</span> <span class="ot">)</span></span>
<span id="cb2-16"><a href="#cb2-16" aria-hidden="true"></a>            <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb2-17"><a href="#cb2-17" aria-hidden="true"></a>        <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb2-18"><a href="#cb2-18" aria-hidden="true"></a>    <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb2-19"><a href="#cb2-19" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/separator&#39;</span> <span class="ot">),</span></span>
<span id="cb2-20"><a href="#cb2-20" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb2-21"><a href="#cb2-21" aria-hidden="true"></a>        <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Product Details&#39;</span><span class="ot">,</span></span>
<span id="cb2-22"><a href="#cb2-22" aria-hidden="true"></a>        <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span></span>
<span id="cb2-23"><a href="#cb2-23" aria-hidden="true"></a>    <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb2-24"><a href="#cb2-24" aria-hidden="true"></a><span class="ot">);</span></span></code></pre>
</div>
<p>The nested array structure mirrors block hierarchy, with each nested array representing child blocks.</p>
<h2 id="template-syntax-explained">Template Syntax Explained</h2>
<p>Each block in the template array follows this structure:</p>
<div class="sourceCode" id="cb3">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true"></a><span class="kw">array</span><span class="ot">(</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true"></a>    <span class="st">&#39;block-name&#39;</span><span class="ot">,</span>           <span class="co">// Required: full block name</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span>                  <span class="co">// Optional: block attributes</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true"></a>        <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;text&#39;</span><span class="ot">,</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true"></a>        <span class="st">&#39;className&#39;</span> =&gt; <span class="st">&#39;custom-class&#39;</span><span class="ot">,</span></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true"></a>        <span class="st">&#39;align&#39;</span> =&gt; <span class="st">&#39;wide&#39;</span></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true"></a>    <span class="ot">),</span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span>                  <span class="co">// Optional: inner blocks</span></span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true"></a>        <span class="co">// Nested block arrays</span></span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true"></a>    <span class="ot">)</span></span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true"></a><span class="ot">)</span></span></code></pre>
</div>
<p>The first element is the block name. The second element sets default attributes. The third element contains child blocks.</p>
<h2 id="fse-block-templates">FSE Block Templates</h2>
<p>Full Site Editing uses block templates for entire page structures. Create HTML template files in your theme’s <code>/templates</code> directory:</p>
<div class="sourceCode" id="cb4">
<pre class="sourceCode html"><code class="sourceCode html"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true"></a><span class="co">&lt;!-- wp:template-part {&quot;slug&quot;:&quot;header&quot;} /--&gt;</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true"></a><span class="co">&lt;!-- wp:group {&quot;layout&quot;:{&quot;type&quot;:&quot;constrained&quot;}} --&gt;</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true"></a><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">&quot;wp-block-group&quot;</span><span class="kw">&gt;</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true"></a>    <span class="co">&lt;!-- wp:post-title /--&gt;</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true"></a>    <span class="co">&lt;!-- wp:post-featured-image /--&gt;</span></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true"></a>    <span class="co">&lt;!-- wp:post-content /--&gt;</span></span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true"></a><span class="kw">&lt;/div&gt;</span></span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true"></a><span class="co">&lt;!-- /wp:group --&gt;</span></span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true"></a></span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true"></a><span class="co">&lt;!-- wp:template-part {&quot;slug&quot;:&quot;footer&quot;} /--&gt;</span></span></code></pre>
</div>
<p>This <code>single.html</code> template defines the structure for single post pages in block themes.</p>
<h2 id="template-parts">Template Parts</h2>
<p>Template parts are reusable sections like headers and footers. Create them in <code>/parts</code>:</p>
<div class="sourceCode" id="cb5">
<pre class="sourceCode html"><code class="sourceCode html"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true"></a><span class="co">&lt;!-- wp:group {&quot;layout&quot;:{&quot;type&quot;:&quot;flex&quot;,&quot;justifyContent&quot;:&quot;space-between&quot;}} --&gt;</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">&quot;wp-block-group&quot;</span><span class="kw">&gt;</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a>    <span class="co">&lt;!-- wp:site-logo /--&gt;</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true"></a>    <span class="co">&lt;!-- wp:navigation /--&gt;</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true"></a><span class="kw">&lt;/div&gt;</span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true"></a><span class="co">&lt;!-- /wp:group --&gt;</span></span></code></pre>
</div>
<p>Save as <code>header.html</code> and reference it in templates with <code>&lt;!-- wp:template-part {"slug":"header"} /--&gt;</code>.</p>
<h2 id="real-world-template-examples">Real-World Template Examples</h2>
<p><strong>Case Study Template:</strong></p>
<div class="sourceCode" id="cb6">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true"></a><span class="kw">$case_study_template</span> = <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Client Name&#39;</span><span class="ot">,</span> <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">1</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Industry and project overview&#39;</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Challenge&#39;</span><span class="ot">,</span> <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span> <span class="ot">),</span></span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Solution&#39;</span><span class="ot">,</span> <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span> <span class="ot">),</span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;content&#39;</span> =&gt; <span class="st">&#39;Results&#39;</span><span class="ot">,</span> <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/list&#39;</span> <span class="ot">),</span></span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/quote&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Client testimonial&#39;</span> <span class="ot">)</span> <span class="ot">)</span></span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true"></a><span class="ot">);</span></span></code></pre>
</div>
<p><strong>Team Member Template:</strong></p>
<div class="sourceCode" id="cb7">
<pre class="sourceCode php"><code class="sourceCode php"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true"></a><span class="kw">$team_template</span> = <span class="kw">array</span><span class="ot">(</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/image&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;align&#39;</span> =&gt; <span class="st">&#39;center&#39;</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/heading&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Full Name&#39;</span><span class="ot">,</span> <span class="st">&#39;level&#39;</span> =&gt; <span class="dv">2</span><span class="ot">,</span> <span class="st">&#39;textAlign&#39;</span> =&gt; <span class="st">&#39;center&#39;</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Job Title&#39;</span><span class="ot">,</span> <span class="st">&#39;align&#39;</span> =&gt; <span class="st">&#39;center&#39;</span><span class="ot">,</span> <span class="st">&#39;className&#39;</span> =&gt; <span class="st">&#39;job-title&#39;</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/paragraph&#39;</span><span class="ot">,</span> <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;placeholder&#39;</span> =&gt; <span class="st">&#39;Bio&#39;</span> <span class="ot">)</span> <span class="ot">),</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true"></a>    <span class="kw">array</span><span class="ot">(</span> <span class="st">&#39;core/social-links&#39;</span> <span class="ot">)</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true"></a><span class="ot">);</span></span></code></pre>
</div>
<h2 id="training-users-on-templates">Training Users on Templates</h2>
<p>Document your templates for content creators:</p>
<ol type="1">
<li>Create a style guide explaining each template’s purpose</li>
<li>Include screenshots showing completed examples</li>
<li>Explain which blocks are required vs optional</li>
<li>Demonstrate how to use placeholder text</li>
<li>Show what they can and cannot modify based on locking</li>
</ol>
<p>Good documentation reduces support requests and improves content quality.</p>
<h2 id="testing-templates">Testing Templates</h2>
<p>Test templates across scenarios:</p>
<ul>
<li>Create new posts to verify template loads correctly</li>
<li>Test with different user roles to ensure permissions work</li>
<li>Verify locked templates prevent unwanted modifications</li>
<li>Check mobile responsiveness of template structure</li>
<li>Test template migration if updating WordPress versions</li>
</ul>
<h2 id="conclusion">Conclusion</h2>
<p>Block templates transform chaotic content workflows into structured, efficient processes. Define templates for custom post types, use appropriate template locking, and train your team. The initial setup investment pays dividends through faster publishing, consistent quality, and reduced revision cycles.</p>
<h2 id="external-links">External Links</h2>
<ol type="1">
<li><a href="https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/block-templates/">Block Templates Documentation</a></li>
<li><a href="https://developer.wordpress.org/block-editor/getting-started/full-site-editing/">Full Site Editing Guide</a></li>
<li><a href="https://developer.wordpress.org/block-editor/how-to-guides/curating-the-editor-experience/">Template Locking</a></li>
<li><a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/">Theme.json Reference</a></li>
<li><a href="https://developer.wordpress.org/themes/block-themes/templates-and-template-parts/">Block Template Parts</a></li>
</ol>
<h2 id="call-to-action">Call to Action</h2>
<p>Streamline your workflow! <a href="https://blocknavigatorplugin.com/#pricing">Block Editor Navigator Pro</a> provides instant block navigation, search, and organization. Find any block in seconds—try it free!</p>
<p>The post <a href="https://developryplugins.com/wordpress-block-templates-streamline-content-creation-workflows/">WordPress Block Templates: Streamline Content Creation Workflows</a> appeared first on <a href="https://developryplugins.com">Developry Plugins</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
