[Resolved] different phone/e-mail in footer on each page

Home Forums Support [Resolved] different phone/e-mail in footer on each page

Home Forums Support different phone/e-mail in footer on each page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #902146
    Marc Witschi

    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

    #902378
    David
    Staff
    Customer Support

    Hi there,

    you could use a WP custom field:

    https://codex.wordpress.org/Custom_Fields

    And then create a simple shortcode to display it, which i provide here:

    https://generatepress.com/forums/topic/create-shortcode/#post-895056

    #902416
    Marc Witschi

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

    #902427
    David
    Staff
    Customer Support

    Custom fields work on pages also.

    #902483
    Marc Witschi

    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?

    #902485
    David
    Staff
    Customer Support

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

    #902489
    Marc Witschi

    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.

    #902511
    David
    Staff
    Customer Support

    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.

    #902521
    Marc Witschi

    Thank you very much!!!

    #902540
    David
    Staff
    Customer Support

    You’re welcome

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.