Section-Based Snippets

Add snippets of code based on current section name of a postpage or subpage .

Note: If you're looking for entirely different templates based on the section name, refer to this documentation instead: Custom Postpage Template or Custom Section Template.


Postpage.xml

Test post.section.title value. Example:

<if test="post.section.original_url=='section_name'">
  <h1>Something specific here for articles in section_name section.</h1>
</if>

Subpage.xml

Test subpage_name value. Example:

<if test="subpage_name=='section_name'">
  <h1>Something specific here for section_name section.</h1>
</if>

You can output any type of code you need inside the <if> statement.

It might be inline <script>, meta tags or <posts>. You can also make use of <import_xml> to render re-usable partials.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like1 Follow
  • 1 Likes
  • 2 yrs agoLast active
  • 235Views
  • 1 Following