A team section the client keeps up to date
People join and leave, and the team section should stay true without a developer. Every person is a row of a list: photo, name, role.
What you get
<section class="team">
<h2 fld-text="Team title">Who makes your coffee</h2>
<div class="team__grid" fld-loop="Team">
<article class="person">
<img class="person__photo" src="images/anna.jpg" alt="Anna at the espresso machine" fld-image="Photo">
<h3 fld-text="Name">Anna</h3>
<p class="person__role" fld-text="Role">Head barista</p>
</article>
<article class="person">
<img class="person__photo" src="images/tom.jpg" alt="Tom with a tray of buns" fld-image="Photo">
<h3 fld-text="Name">Tom</h3>
<p class="person__role" fld-text="Role">Baker</p>
</article>
</div>
</section>The client added the third person in the admin.
Step by step
The list goes on the grid of cards
fld-loop on the block that holds the people’s cards.
<div class="team__grid" fld-loop="Team">
The photo
fld-image right on the
<img>. In the admin it is an image field; the build removes the markup’ssrcset.<img class="person__photo" src="images/anna.jpg" alt="Anna at the espresso machine" fld-image="Photo">
Name and role
Both lines are fld-text, with different names.
<h3 fld-text="Name">Anna</h3> <p class="person__role" fld-text="Role">Head barista</p>
The other cards the same way
Every card carries the same attributes and names, so “Load data” brings everyone into the admin.
<article class="person"> <img class="person__photo" src="images/tom.jpg" alt="Tom with a tray of buns" fld-image="Photo"> <h3 fld-text="Name">Tom</h3> <p class="person__role" fld-text="Role">Baker</p> </article>
What matters
- The photo’s description (
alt) comes from the WordPress media library, each picture its own. Fill in “Alternative Text” for the photo there; the markup’saltdoes not reach the site. - The client reorders people by dragging rows.
Common mistakes
The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.
<div class="team__grid" fld-loop="Team">
<article class="person">
<h3 fld-text="Name">Anna</h3>
</article>
<article class="person">
<h3 fld-text="Full name">Tom</h3>
</article>
</div>The second card names the field differently (“Full name” instead of “Name”): the template works, but “Load data” does not bring Tom’s name in. The log stays silent.
<div class="team__grid" fld-loop="Team">
<article class="person">
<h3 fld-text="Name">Anna</h3>
</article>
<article class="person">
<h3 fld-text="Name">Tom</h3>
</article>
</div>The same field names in every card.