The Twenty Seventeen header displays two text boxes: the Site Title and the Tagline. I would like to add a new text box at the top right of the screen. How can I do it?

I have an active Twenty Seventeen child theme.


That works if you put your code in header.php, copied in the childtheme, after the line:

<header id="masthead" class="site-header" role="banner">

My html code is:

<div class="logo-right-text">
<span style="font-size: 14px; font-weight: bold; color: #555;">1800-123-456-22</span>
<div class="clear" style=" height:3px;"></div>
<span style="font-size: 14px; font-weight: bold; color: #555; ">contact@mondomain.com</span>

And CSS:

div.logo-right-text{ margin: 0px 10px; }
div.logo-right-text { float: right; text-align: right; }
.logo-right-text{ padding-top: 42px; }

But finaly I'll try to put these 2 phone and mail in the menu line... if I find how to do ;)

| improve this answer | |

In the original Twenty Seventeen theme, find which file is used to display the Site Title and the Tagline. Then in your child theme, recreate this file, and edit it to include your text box.

| improve this answer | |
  • I can add more text in my child theme's header.php - but this is a hack. I want to see an example of how to add a new (text) box which can be styled and positioned. – Astrophe Apr 23 '17 at 17:07
  • My understanding that the whole purpose of child themes is they allow you to redefine different components of the original theme, without affecting the themes original files. Therefore, changing the header.php file in the child them is not a hack, it is the whole purpose of a child theme. – Greeso Apr 23 '17 at 19:55
  • I'm looking for an example of how to include a text box in the top right of the screen - which files handle the site-title and the tag-line and their configuration? – Astrophe Apr 23 '17 at 21:53
  • I am don't have my development environment set now, but the file you are looking to modify in your theme is template-parts/header/site-branding.php. You could modify this file in your child theme. Hope this helps. – Greeso Apr 24 '17 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.