Site logo

Archived topic

Multiple category display with separation in header elements

3 replies · Started by davide on June 11, 2019

Viewing posts 1–4 of 4

Hello, I am designing the haeder element for a blog post. This is the code for the template tags.

<!-- Home Hero -->
<h1 style>
{{post_title}}
</h1>
<h3 style="background-color:white; color:white; text-transform:lowercase; width:25%; margin:auto;">
({{post_terms.category}})
</h3>

Since I have multiple categories assigned to a post, is there a way to separate them in the header? If I use the code as above, they show like "Category 1 Category 2 Category 3 etc."

Thank you
Davide

Hi there,

how would you want to separate them? With a pipe '|' between them?
If so you could use this CSS:

.page-hero h3 a:not(:first-child):before {
    content: '|\00a0';
}
This archived topic is closed to new replies.