Site logo

Archived topic

different phone/e-mail in footer on each page

9 replies · Started by Marc Witschi on May 16, 2019

Viewing posts 1–10 of 10

I'd like to display a different phone number and e-mail address in the footer on each page of my website.
https://ibb.co/0rLCXTw

Do you know any possibility to do this?
Thank you in advance

I use pages, not posts. I think then I'm not able to use WP custom fields, or am I?

Custom fields work on pages also.

I think I don't get it with those custom fields. I have no idea where to create them and where to put them...

I found a way on the internet where I should create different footer.php an then select them with an if/else-if/else in the page.php
https://www.wphub.com/blog/posts/show-different-footer-wordpress-pages/

I tried but didn't understand how the footer.php works. I couldn't find where to put text, where to format, and and and ....
I'm pretty confused, can you explain me one (or both) options above?

How many different phone numbers will there be ? Are there a lot of pages with different numbers?

There will be total 5 different phone numbers and also 5 different e-mail-addresses.
Means there are three pages (+3 subpages) with the same number/mail and then always one page (+1 or +2 subpages) with a different number/mail.

May be simplest to use the Hook Element to add the markup to your page:

https://docs.generatepress.com/article/hooks-element-overview/

Use the Footer hook and you can disable the site footer.

Then use the current markup like so:

<footer class="site-info" itemtype="https://schema.org/WPFooter" itemscope="">
    <div class="inside-site-info grid-container grid-parent">
        <div class="copyright-bar">
            <p>Kinderheim Friedau ' Bern-Zürichstrasse 28 ' 3425 Koppigen ' Telefon <a href="tel:+4134 413 11 37">034
                    413 11 37</a> ' Fax <a href="#" style="color:white" class="inactiveLink">034 413 11 38</a></p>
            <p><a href="mailto:mail@kinderheimfriedau.ch">mail@kinderheimfriedau.ch</a> ' PC: <a href="#"
                    style="color:white" class="inactiveLink">CH68 0900 0000 3400 1670 8</a> ' UBS: <a href="#"
                    style="color:white" class="inactiveLink">CH02 0026 2226 7F68 0234 2</a></p>
        </div>
    </div>
</footer>

The Display Rules tab will allow you to select which pages you want it displayed on. Then just create a new Hook for each of the different versions and set the different display rules.

Thank you very much!!!

You're welcome

This archived topic is closed to new replies.