• Resolved figure2

    (@figure2)


    Hi Tom, my client wants me to add phone numbers below both logos in the header of his website. The right logo will be easy since it’s using the header widget.

    The left side is more of a challenge since this child theme is using <?php generate_construct_logo() ;?> to render the logo.

    How do I get at the code this function references to add the text into the “site-logo” div?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author Tom

    (@edge22)

    If you install the development version of GP, there’s a generate_after_logo hook you can use: https://github.com/tomusborne/GeneratePress

    add_action( 'generate_after_logo', 'your_function_name' );
    function your_function_name()
    { ?>
        Your content/code/whatever in here
    <?php }
    Thread Starter figure2

    (@figure2)

    Thanks Tom, is this theme premium or somehow different than the theme on the WordPress theme repository?

    Also would I repalce the “Your content/code/whatever in here” with something like echo "<p>123-456-7891</p>";?

    Theme Author Tom

    (@edge22)

    It’s the free theme, but the development version, so not the version available on www.remarpro.com yet.

    That’s exactly right ??

    Thread Starter figure2

    (@figure2)

    Hi Tom, here is where I am with this. This is my development site on my testing server so I can experiment without doing horrible things to my client’s site: https://americandrystripping.markhannondesign.com/home

    There are 2 instances of the phone number added to the logo.

    1. The phone number directly underneath the logo was created by adding a p tag to the logo section in the template-tags.php file in the parent folder. I tried moving a modified copy of template-tags.php to my child theme folder but my child theme only recognized the copy in the parent theme.
      This solution is ideal because I can control the look, style and position of the phone number. But it’s also unworkable since the phone number will disappear as soon as you update the parent theme.
    2. The other phone number to the right of the logo was created by using the add_action above. I realized that it places the content outside of the .site-logo div which causes it to be placed to the right of the logo rather than underneath.

    Is there a hook that will allow me to override the logo code in template-tags.php? This way I could place the phone number where it needs to go.

    Thanks.

    Theme Author Tom

    (@edge22)

    Absolutely, all of the functions in template-tags.php are wrapped in function_exists() conditionals, meaning you can copy the whole function (include the function_exists() function) and add it to your child theme/functions file.

    It will then overwrite the function in template-tags.php, while not having to overwrite all the functions in there by copying the entire file.

    Let me know if that helps or not ??

    Thread Starter figure2

    (@figure2)

    All set Tom. Thanks. Dropped the logo function from template-tags.php into my child theme functions file. Good to go now.
    https://www.americandrystripping.com/home/

    Theme Author Tom

    (@edge22)

    Awesome, glad I could help ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add a line of text below the site logo’ is closed to new replies.