Home › Forums › Support › Adding a button to header This topic has 7 replies, 3 voices, and was last updated 7 years, 8 months ago by Tom. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts August 10, 2015 at 9:04 pm #128292 bbrdavid I’d like to put a button in the middle of the header just like in the wpcurve.com homepage. Would I do this with hooks? Could you point me to some sample code? Thanks very much, sorry if this is a very basic question. August 10, 2015 at 11:53 pm #128310 TomLead Developer Lead Developer Hi there, You could do this using hooks, the Page Header add-on or the Sections add-on. You would first add the HTML for the button: <a class="custom-button" href="https://generatepress.com">GeneratePress</a> Then you would have to style that button: .custom-button, .custom-button:visited { display: inline-block; padding: 5px 10px; border: 2px solid #FFF; } .custom-button:hover { background: #000; color: #FFF; } Adjust as needed π August 11, 2015 at 12:00 am #128314 bbrdavid Awesome, Tom! And I even understand it…guess I’m learning π August 11, 2015 at 12:02 am #128316 TomLead Developer Lead Developer Awesome! π July 28, 2016 at 3:51 pm #213729 Rylan Urban How can I get the button centered on the whole header, no just the text area? like on http://voyagesolarenergy.com the button is centered under the text. I want it centered under all of of the text + logo (currently placed in after-header content hook) July 28, 2016 at 4:52 pm #213740 TomLead Developer Lead Developer Since the elements are set to display: inline-block, they’ll do their best to fill in the spaces. If you want it to clear below those two elements, you need to add a clear element above the button: <div class="clear"></div> button HTML here July 28, 2016 at 9:46 pm #213772 Rylan Urban Perfect π DIdn’t know that code existed! July 28, 2016 at 11:31 pm #213775 TomLead Developer Lead Developer Glad I could help π Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In