Help positioning custom header widget
-
Hello!
I’m trying to create a custom widget area above my main navigation to include a search bar. Following your advice on a few older posts, I created the custom widget area and added the widget title class, header-right-widget.
Then, I added the following custom CSS to my styles.css:
.header-right-widget{
width: 500px;
float: right;
}I inserted the widget area into my header.php file using the code below:
<div class=”header-right-widget”><?php dynamic_sidebar( ‘header-widget’ ); ?></div>I’m not certain that placed the code in the correct location, however the result is a search bar that is positioned all the way at the very top far right of the page. In addition, even though the search bar widget appears, it doesn’t seem to be working – when clicked, nothing happens, and text does not appear in the search bar when typed. When accessing the site on mobile, the widget doesn’t re-size with the screen size. Since I set it to be 500px wide, it cuts off the side of the display.
Ideally, I’d like to have this widget float on top of my main navigation, aligned to the right hand side of the page (website: pistilsnursery.com). How can I modify my code to achieve this?
Happy to provide any and all additional info and/or screenshots.
Thank you!
Jesse
- The topic ‘Help positioning custom header widget’ is closed to new replies.