A link or a button the client can change
fld-link="Field name" The address of a link becomes a field in the admin. The caption is a separate text field next to it, so the client can change either.
Where it goes
On the <a>: the build changes only its href. Mark the caption inside with fld-text under another name.
Naming that never collides: the link “Hero button”, the caption “Hero button text”.
The field appears in the admin only if the page has a group name: wp-fields-group on its <body>.
Example: the button in the hero
<a class="button" href="/menu" fld-link="Hero button">
<span fld-text="Hero button text">See the menu</span>
</a>What matters
- The field holds the address as text:
/menu,https://…,tel:+1…. - A link with
href="#"starts empty: there is nothing to carry over. - Link and caption need different names, otherwise they become one field.
Common mistakes
The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.
<a href="/menu" fld-link="Button">
<span fld-text="Button">See the menu</span>
</a>Link and caption under one name: the build log reports a collision, and one field feeds both the address and the text.
<a href="/menu" fld-link="Button">
<span fld-text="Button text">See the menu</span>
</a>The caption is “Button text”.
<div class="button" fld-link="Hero button">See the menu</div>Not a link: the address lands on a <div> and nothing is clickable. The build log flags the wrong element.
<a class="button" href="/menu" fld-link="Hero button">See the menu</a>On an <a>.
The same in site settings
fld-link | on a page or post |
|---|---|
opt-link | in site settings, such as a booking link in the header |
Alternative spelling
f_link, o_link works the same: the build gives an identical theme.