-
AuthorPosts
-
August 21, 2015 at 8:42 pm #491597
I added a custom search box to the header using the code I found in these forums.
I want the search box to be right-aligned with the right side of the site content (just like the phone-info text in the top bar).
I can’t figure out how to do it. With my CSS (position: absolute;top: 14px;right: 212px;) it aligns it correctly for my monitor resolution, but it gets messed up when I resize the browser window. I want the search box to be right-aligned regardless of the window size.
Your help is really appreciated!
August 22, 2015 at 6:52 pm #491743Hey goforyourdreams!
Thank you for using our theme.
Replace your code with the following:
.header-search { float: right; margin-right: 50px; position: relative; top: 14px; z-index: 999; }
Regards,
GünterNovember 13, 2015 at 6:11 pm #535611Unfortunately this code didn’t work. It made the search box right-aligned all the way to the edge of the screen, and also somehow made my logo move down out of position. Here’s the screenshot of how it looked with the new code: http://yourwebsiteasap.com/screenshot-moriah-searchbox.png
I need the searchbox (header custom content) to be right-aligned to the edge of the CONTENT, not to the edge of the screen. I want it to behave the same way as the tagline (“phone-info” text), which is right-aligned to the edge of the content even when I resize the screen.
I appreciate your help!
November 16, 2015 at 6:31 pm #536770Hey!
It’s currently displaying outside of the header container. What is the code you used to add it in?
Best regards,
ElliottNovember 16, 2015 at 8:52 pm #536875Here’s the code I put into functions.php to add custom code (search form) to header:
function custom_code_header(){ echo "<div class='header-search'>"; get_search_form(); echo "</div>"; } add_action('ava_main_header', 'custom_code_header');
November 18, 2015 at 6:27 pm #538438Hey!
Try the “ava_after_main_menu” hook instead. It is inside the header container.
Best regards,
ElliottNovember 19, 2015 at 3:49 am #538689Awesome! That did the trick, thank you so much!
November 20, 2015 at 7:38 am #539363 -
AuthorPosts
- You must be logged in to reply to this topic.