{"id":32,"date":"2025-06-12T14:30:07","date_gmt":"2025-06-12T14:30:07","guid":{"rendered":"https:\/\/devblog.40kts.cloud\/?p=32"},"modified":"2025-06-12T14:30:07","modified_gmt":"2025-06-12T14:30:07","slug":"how-to-change-the-term-separator-in-bricks-builder-2","status":"publish","type":"post","link":"https:\/\/devblog.40kts.cloud\/index.php\/2025\/06\/12\/how-to-change-the-term-separator-in-bricks-builder-2\/","title":{"rendered":"How to Change the Term Separator in Bricks Builder"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">How to Change the Term Separator in Bricks Builder<\/h2>\n\n\n\n<p>Bricks Builder uses dynamic tags like <code>{post_terms_category}<\/code> to display taxonomy terms such as categories or tags. By default, multiple terms are separated by a comma and a space, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Design, Innovation, Strategy<\/code><\/pre>\n\n\n\n<p>If you want to use a different separator \u2014 such as a pipe (<code>|<\/code>), dot (<code>\u00b7<\/code>), or simple space \u2014 there are two options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 1: Change the separator globally via filter<\/h3>\n\n\n\n<p>The following code can be added to your <code>functions.php<\/code> file to override the default separator:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'bricks\/dynamic_data\/post_terms_separator', fn() =&gt; ' \u00b7 ', 10 );<\/code><\/pre>\n\n\n\n<p>This replaces the comma with a middle dot, so the result becomes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Design \u00b7 Innovation \u00b7 Strategy<\/code><\/pre>\n\n\n\n<p>This method applies globally and affects all dynamic tags using <code>{post_terms_taxonomy}<\/code> \u2014 as long as they are used without surrounding text.<\/p>\n\n\n\n<p><strong>Important:<\/strong> The filter only applies if the tag is used on its own. For example, this will work:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{post_terms_category}<\/code><\/pre>\n\n\n\n<p>\u2026but this will not:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Categories: {post_terms_category}<\/code><\/pre>\n\n\n\n<p>In such cases, Bricks treats the output as plain text and ignores the filter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 2: Use a custom separator inline<\/h3>\n\n\n\n<p>Bricks also supports inline separators directly in the dynamic tag. You can write:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{post_terms_category separator=\" | \"}<\/code><\/pre>\n\n\n\n<p>This overrides the default and outputs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Design | Innovation | Strategy<\/code><\/pre>\n\n\n\n<p>This approach is useful if you want to vary the separator in different locations without modifying global behavior.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Summary<\/h3>\n\n\n\n<p>Use a filter if you want a consistent separator across the entire site, or define it inline for case-by-case control. Avoid wrapping dynamic tags in surrounding text if you want filters to apply correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Change the Term Separator in Bricks Builder Bricks Builder uses dynamic tags like {post_terms_category} to display taxonomy terms such as categories or tags. By default, multiple terms are separated by a comma and a space, for example: If you want to use a different separator \u2014 such as a pipe (|), dot (\u00b7), [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":1,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":33,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions\/33"}],"wp:attachment":[{"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblog.40kts.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}