Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!

    #491743

    Hey 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ünter

    #535611

    Unfortunately 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!

    #536770

    Hey!

    It’s currently displaying outside of the header container. What is the code you used to add it in?

    Best regards,
    Elliott

    #536875

    Here’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');
    #538438

    Hey!

    Try the “ava_after_main_menu” hook instead. It is inside the header container.

    Best regards,
    Elliott

    #538689

    Awesome! That did the trick, thank you so much!

    #539363

    Hi,

    Glad we could help :-)

    Cheers!
    Rikard

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