Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Section recipes
  3. Site-wide contacts
Recipe 4 steps

Contacts and opening hours across the site

The phone and address sit in the footer, in the header, on the contacts page. So the client does not hunt for them all over the site, move them to site settings: change once, changed everywhere.

What you get

Markup theme-options.html · index.html
<!-- theme-options.html and the footer of every page: the same markup -->
<body wp-fields-group="Site settings">
<footer class="footer">
  <a class="footer__phone" href="tel:+15550100199" opt-link="Phone link">
    <span opt-text="Phone">+1 (555) 010-0199</span></a>
  <p class="footer__address" opt-area="Address">12 Linden Street, Portland, OR</p>
  <ul class="footer__hours" opt-loop="Opening hours">
    <li><span fld-text="Days">Mon–Fri</span> <span fld-text="Hours">7:00–19:00</span></li>
    <li><span fld-text="Days">Sat–Sun</span> <span fld-text="Hours">8:00–17:00</span></li>
  </ul>
</footer>
</body>
In the admin ThemeForge → Options
Site settings
Phone link tel:+15550100199
Phone +1 (555) 010-0199
Address 12 Linden Street, Portland, OR
Opening hours
1
Days Mon–Fri
Hours 7:00–19:00
2
Days Sat–Sun
Hours 8:00–17:00
Add Row
On the site footer of every page

+1 (555) 010-0199

12 Linden Street, Portland, OR

Mon–Fri 7:00–19:00
Sat–Sun 8:00–17:00

The same fields can be shown on any page; the value is one.

Step by step

  1. The site settings page

    Put the footer markup into theme-options.html as well, with a wp-fields-group group: that puts the fields on the settings screen.

    <body wp-fields-group="Site settings">
  2. The phone: link and number

    opt-link on the tel: link and opt-text on the number. The client changes both: the link that dials and what the site shows.

    <a class="footer__phone" href="tel:+15550100199" opt-link="Phone link">
      <span opt-text="Phone">+1 (555) 010-0199</span></a>
  3. The address

    opt-area is an address of several lines; the line breaks are kept.

    <p class="footer__address" opt-area="Address">12 Linden Street, Portland, OR</p>
  4. Opening hours are a list

    opt-loop on the list of days: the client adds “holidays” as a separate row. The fields inside a row are fld-text.

    <ul class="footer__hours" opt-loop="Opening hours">
      <li><span fld-text="Days">Mon–Fri</span> <span fld-text="Hours">7:00–19:00</span></li>

What matters

  • On the site’s pages the footer markup is the same as in theme-options.html: opt- attributes read site settings wherever they stand.
  • Do not make site-wide values page fields, or the client will have to change the phone on every page.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<a class="footer__phone" href="tel:+15550100199" opt-text="Phone">+1 (555) 010-0199</a>

The number as a field right on the link: the text changes, but href="tel:…" stays from the markup, so calls go to the old number. The log stays silent.

Like this
<a class="footer__phone" href="tel:+15550100199" opt-link="Phone link">
  <span opt-text="Phone">+1 (555) 010-0199</span></a>

The link is opt-link, the number inside it opt-text.

Attributes in this recipe

Ready when you are

See your site’s WordPress admin before you pay.